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: Paolo Bonzini
Subject: [Qemu-devel] Re: [PATCH 07/21] add assertions on the owner of a QemuMutex
Date: Mon, 21 Feb 2011 11:15:39 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.7

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

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