|
From: Steven Stewart-G. <sst...@my...> - 2014-05-13 21:35:20
|
> I think I observed a strange behaviour on Linux which does not comply > with POSIX. > That is, POSIX mandates that a thread blocked on pthread_cond_wait() > and canceled > via pthread_cancel() gets unblocked, the corresponding mutex > re-acquired and _then_ > cancellation cleanup handlers called. > However on Linux this was not true - thread unblocked from > pthread_cond_wait() did > not re-acquire the associated mutex. Thank you, Ivo Raisr. That makes sense and seems to fix my problem. I think the relevant section of POSIX is: > A side-effect of acting on a cancellation request while a thread is > blocked on a condition variable is to re-acquire the mutex before > calling any of the cancellation cleanup handlers. I find it strange that GLibc does not implement this case properly. |