On 02/21/2011 10:50 AM, Jan Kiszka wrote:
>  +    /* An EDEADLOCK would arrive after we reset the owner.  So this
>  +       assert is for ease of debugging (it lets you see what is the
>  +       actual owner.  */

Don't get this. Why do you want to avoid the proper error detection of
pthread?

Because by the time you get to error_exit mutex->owner has been NULL-ed out already. So it doesn't help to put a breakpoint on error_exit, you cannot find out which thread was the owner.

But the assertions in the mutex layer
are redundant for PTHREAD_MUTEX_ERRORCHECK - unless I'm missing
something now.

Yes, but tracking the mutex's owner gives a bit more specific information when an error happens even for mutexes. I removed them from lock/trylock, but for unlock it's already too late when the error happens.

Paolo

Reply via email to