Il 25/02/2014 17:17, Stefan Hajnoczi ha scritto:
For the default mutex type (PTHREAD_MUTEX_TIMED_NP) glibc looks safe to
me.  The other mutex types are trickier and I haven't audited them.

It also depends on the low-level lock implementation. I looked at the C one and it's not safe, the x86-optimized one is hard to follow.

I think I was looking at a different race, namely cases where the locking thread uses a fast path, while the unlocking thread plays it safe and uses the slow path instead. Then the slow path can run "asynchronously" from the locking thread, and the locking thread has time to unlock and destroy the mutex. See the other message.

Paolo

Reply via email to