sending signal to thread waiting on pselect
I am trying to implement the following scenario in the multithread application.
// main function of the application prepares global setting ....
// block reception of SIGCONT signal using sigsetmask call
sigset_t sigmask,oldmask;
sigemtyset(&sigmask);
sigaddset(&sigmask,SIGCONT);
sigprocmask(SIG_BLOCK,&sigmask,&oldmask);
// set global service for SIGCONT
signal(SIGCONT,sighndlr)
// ...
// s-thread waits on pselect on events on file descriptor sets enabling reception of SIGCONT
rc=pselect(max,&rfds,&wfds,&exfds,NULL,&oldmask);
// ... and in the mean time
// w-thread sends the SIGCONT to the s-thread informing that status of fdsets have changed
pthread_kill( s_thread_id, SIGCONT );
The above scenario I have tried with glibc 2.3.2 on Fedora with nptl library. The result is always the same. The application process disapear from the system.
What I am doing wrong?
Has anybody an idea how to wakeup the thread waiting on the (p)select system call using signals?
|