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.
pthread_cond_wait() is not supposed to return if a signal is received: https://pubs.opengroup.org/onlinepubs/009696699/functions/pthread_cond_wait.html
EINTR is not one of the valid return values from pthread_cond_wait().