qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [PATCH 07/21] add assertions on the owner of a QemuMute


From: Jan Kiszka
Subject: [Qemu-devel] Re: [PATCH 07/21] add assertions on the owner of a QemuMutex
Date: Mon, 21 Feb 2011 11:22:25 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

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

[Prev in Thread] Current Thread [Next in Thread]