I have a thread blocked on a mutex. The application also has custom signal handlers, set using sigaction
. If the thread that receives a catchable signal is blocked on a mutex, will the signal handler be called, or will it be blocked until the mutex is released?
Most probably it will depend on implementation, in pthread
for example signal handler will be executed and then thread will wait for mutex upon handler return:
man pthread_mutex_lock
If a signal is delivered to a thread waiting for a mutex, upon return from the signal handler the thread shall resume waiting for the mutex as if it was not interrupted.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With