From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:43567) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6Mza-0005NQ-73 for qemu-devel@nongnu.org; Wed, 21 Sep 2011 09:37:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R6MzU-0006NV-Cp for qemu-devel@nongnu.org; Wed, 21 Sep 2011 09:37:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:1492) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6MzT-0006N3-Uv for qemu-devel@nongnu.org; Wed, 21 Sep 2011 09:37:32 -0400 Message-ID: <4E79E94C.6040708@redhat.com> Date: Wed, 21 Sep 2011 15:40:28 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <3beaa0c559cd7f2df1299e7385a8997165c0f851.1316537591.git.jan.kiszka@siemens.com> <4E798F66.4070809@redhat.com> In-Reply-To: <4E798F66.4070809@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/6] Enable joinable POSIX threads List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Jan Kiszka , Anthony Liguori , Alon Levy , qemu-devel@nongnu.org Am 21.09.2011 09:16, schrieb Paolo Bonzini: > On 09/20/2011 06:53 PM, Jan Kiszka wrote: >> - qemu_thread_create(&thread_id, event_thread, card); >> - qemu_thread_create(&thread_id, handle_apdu_thread, card); >> + qemu_thread_create(&thread_id, event_thread, card, QEMU_THREAD_DETACHED); >> + qemu_thread_create(&thread_id, handle_apdu_thread, card, >> + QEMU_THREAD_DETACHED); >> return 0; >> } > > I think these two should be joinable. Otherwise, you might be > destroying the apdu_thread_quit_mutex while the handle_apdu_thread > hasn't yet finished unlocking it (even though it already progressed > enough in qemu_mutex_destroy to release the main thread). > > Anyhow, the bug is not introduced by your patch, so > > Reviewed-by: Paolo Bonzini Actually, the man page says that joinable is the default, so this patch does change the behaviour. Kevin