[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/6] Enable joinable POSIX threads
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH 1/6] Enable joinable POSIX threads |
Date: |
Wed, 21 Sep 2011 15:40:28 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:6.0.2) Gecko/20110906 Thunderbird/6.0.2 |
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 <address@hidden>
Actually, the man page says that joinable is the default, so this patch
does change the behaviour.
Kevin