On 2011-02-21 11:15, Paolo Bonzini wrote:
> 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.

That's easy, "p <my_mutex>" will tell (the structure contains the
owner's tid).

And for debugging invalid mutex_unlock calls, it's more interesting to
track the call path of that thread which incorrectly claimed to hold the
lock.

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux

Reply via email to