I'm working with Linux pthreads, from the glibc 2.2.3.
The problem occurs when I try to shut down my aplication controlled by receiving signal SIGTERM. The root thread receives the signal and makes a pthread_cancel() to all threads and waits with pthread_join() for cancellation. But a thread waiting on pthread_cond_timedwait() doesn`t cancel and so pthread_join() doesn`t return.
Could anyone explain this behaviour to me?
while (gotSig == 0)
sigwait (&SigMask, &SigNum);
if ((SigNum == SIGTERM) || (SigNum == SIGKILL))
pthread_cancel ( task1_id );
pthread_join ( task1_id, (void **)NULL )
Thanx for your answers,