Im trying to get a thread to handle all signals sent by all threads of the same process but to no avail. The only way I can get the thread handler to work is to set a global signal handler which then sends the signal to the signal handler thread which then sets a global signal variable which other threads can look at.
In other words, blocking all signals in a main process, starting a thread to sigwait on all blocked signals, performing a zero divide in main thread doesn't work, the program bombs.
Conversely, do the same above except declaring a global signal handler, which then catches the signal, sends it to the sigwait thread does work but with timing issues using mutexes(that is by the time the sigwait thread trys to lock the mutex the main code body has already ripped through). I get it to work by using a sleep func.
Anyway, the IBM site samples tend to assume a main thread controls everything and you actually know the signal catching.
Any other ideas? Thanks! _________________________________________________________________Want a degree but can't afford to quit? Top school degrees online - in as fast as 1 year http://forms.nextag.com/goto.jsp?url=/serv/main/buyer/education.jsp?doSearch=n&tm=y&search=education_text_links_88_h288c&s=4079&p=5116
As an Amazon Associate we earn from qualifying purchases.
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.