pthread_exit is not safe with respect to an asynchronous signal, and thus the only way to call it from a signal handler is to make sure that the signal does not interrupt any function without an asynchronous signal.
, . , : ( ) .
, , pthread_cancel. , , , , / , ( pthread_setcancelstate). , , pthread_mutex_lock . , , , , , , , , ( condvar ), .
: , , pthread_mutex_lock , pthread_mutex_timedlock .