I am attempting to create a thread dedicated to "handling" signals by:
1) blocking all async signals (INT, TERM, QUIT, HUP) in the "main" thread
2) create a thread to do signal handling - this thread loops on sigwait for
the previously blocked async signal set.
3) create other threads to do the work of the application.
Now, this works just fine, except for one little problem.
Upon return from sigwait, the signal handler thread may block waiting for
a mutex or for some other reason. If another instance of the signal is
raised
during this time, the application takes the default behavior - exits.
Now, all of the threads I created have the signal blocked, since I blocked
it in main, and all threads inherit the signal mask. But, there are a
couple
of other threads that are started by the system, in addition to the thread
that main is called on. Is it possible that the signal is being delivered
to
one of these threads, and the default action is then running its course?
If so, is there anything I can do about it?
If there isn't then sigwait would seem to be of very little utility.
This is on a solaris 2.5.1 system, by the way.
Thanks
============================================================
Roger S. Reynolds
Web: http://www.rogerware.com