On 10/14/2010 11:02 AM, Stefan Hajnoczi wrote:
2. Moving qemu_cond_signal() outside queue->lock is dangerous for the
same reason: you need to be careful not to qemu_cond_signal() when the
thread isn't inside qemu_cond_timedwait()."

Yes, please do so.

I personally consider it bad programming practice to put the condvar signal/broadcast outside the mutex. While I understand that my ideas may not matter much, some Mr. Hoare actually invented them without signal-outside-lock, and he probably knows better than anyone reading.

Paolo

Reply via email to