From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=47513 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PrSny-0000zk-JT for qemu-devel@nongnu.org; Mon, 21 Feb 2011 05:15:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PrSnw-0003e0-En for qemu-devel@nongnu.org; Mon, 21 Feb 2011 05:15:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:5695) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PrSnw-0003db-4c for qemu-devel@nongnu.org; Mon, 21 Feb 2011 05:15:44 -0500 Message-ID: <4D623B4B.8020306@redhat.com> Date: Mon, 21 Feb 2011 11:15:39 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1298277820-8817-1-git-send-email-pbonzini@redhat.com> <1298277820-8817-8-git-send-email-pbonzini@redhat.com> <4D623556.7050204@siemens.com> In-Reply-To: <4D623556.7050204@siemens.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 07/21] add assertions on the owner of a QemuMutex List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: qemu-devel@nongnu.org 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