I'm not expecting the task to be killed, but the pthread_cond_wait to return when the process receives a signal (which I'm handling in a signal handler).
What I need is to exit the pthread_cond_wait upon reception of the signal. As I mentioned, doing pthread_cond_signal from the handler did not work (and seems not to be safe) and now I was trying to enable cancellation points so that the signal itself cancels pthread_cond_wait. Best, Matias On Tue, Jan 12, 2021, at 21:00, Gregory Nutt wrote: > > > > I'm having an issue when waiting on a pthread condition variable from > > the main thread and then a signal handler runs, which should cancel > > the wait since I have cancellation points enabled, however this did > > not happen. > > I don't understand this either. A signal will not, in general, cause a > task to be killed. The DEFAULT behavior of some signals (if enabled) > will kill the task. > > However, if you have connected a signal handler via sigaction(), then > you have also disabled the default behavior and the task will not be killed. > >