I'm writing a library and need to send a custom signal to threads, I used signal(SIGRTMIN, handler);
and all works fine.
Since this is a library, I'm worried that some one who used my library will also use this SIGRTMIN
, so this there any way in linux/posix_thread to get an unique SIGRTMIN id?
currently my way to solve this is to add a magic number, like SIGRTMIN + MAGIC_NUMBER
to reduce the change of duplicate signals, but I wondered if there's a better solution.