qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2] qemu_mutex_iothread_locked not correctly syn


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v2] qemu_mutex_iothread_locked not correctly synchronized
Date: Wed, 25 Nov 2015 14:26:30 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0


On 25/11/2015 13:31, David Engraf wrote:
> Hi Paolo,
> 
> please check the new version. I removed changing the iothread_locked
> variable. But I still need to set the correct value of iothread_locked
> when using qemu_cond_wait. 

No, you don't.  Who is reading iothread_locked during
qemu_cond_wait_iothread?  No one, because it is a thread-local variable
whose address is never taken.

Paolo

> +static void qemu_cond_wait_iothread(QemuCond *cond)
> +{
> +    iothread_locked = false;
> +    qemu_cond_wait(cond, &qemu_global_mutex);
> +    iothread_locked = true;
> +}



reply via email to

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