From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:43998) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6H3G-0003QU-2a for qemu-devel@nongnu.org; Wed, 21 Sep 2011 03:17:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R6H3E-00007Y-MF for qemu-devel@nongnu.org; Wed, 21 Sep 2011 03:17:02 -0400 Received: from mail-gy0-f173.google.com ([209.85.160.173]:53386) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6H3E-00007S-GR for qemu-devel@nongnu.org; Wed, 21 Sep 2011 03:17:00 -0400 Received: by gye5 with SMTP id 5so1188348gye.4 for ; Wed, 21 Sep 2011 00:17:00 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <4E798F66.4070809@redhat.com> Date: Wed, 21 Sep 2011 09:16:54 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <3beaa0c559cd7f2df1299e7385a8997165c0f851.1316537591.git.jan.kiszka@siemens.com> In-Reply-To: <3beaa0c559cd7f2df1299e7385a8997165c0f851.1316537591.git.jan.kiszka@siemens.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed 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: Jan Kiszka Cc: Anthony Liguori , Alon Levy , qemu-devel@nongnu.org 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