[libvirt] [PATCH 1/14] Adding recursive locks

Paolo Bonzini pbonzini at redhat.com
Mon Mar 22 10:28:44 UTC 2010


On 03/18/2010 06:04 PM, Eric Blake wrote:
>>> >>
>>> >>  ACK.  I had to double-check MSDN to make sure that threads-win32 already
>>> >>  creates recursive mutex by default.
>> >
>> >  I don't supposed you read if its possible to make it non-recursive, since
>> >  the orginal impl is supposed to be non-recursive !
>
> Unfortunately, I don't see a way:

You use an event instead (automatically reset, initially set):

   hEvent = CreateEvent (NULL, FALSE, TRUE, NULL);

To acquire the mutex you use WaitForSingleObject, to release the mutex 
you use SetEvent.

Paolo




More information about the libvir-list mailing list