OSDN Git Service

unlock iothread during WaitForMultipleObjects
authorPaolo Bonzini <pbonzini@redhat.com>
Sat, 12 Mar 2011 16:43:48 +0000 (17:43 +0100)
committerBlue Swirl <blauwirbel@gmail.com>
Sun, 13 Mar 2011 14:44:20 +0000 (14:44 +0000)
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
os-win32.c

index b214e6a..c971d92 100644 (file)
@@ -140,7 +140,9 @@ void os_host_main_loop_wait(int *timeout)
         int err;
         WaitObjects *w = &wait_objects;
 
+        qemu_mutex_unlock_iothread();
         ret = WaitForMultipleObjects(w->num, w->events, FALSE, *timeout);
+        qemu_mutex_lock_iothread();
         if (WAIT_OBJECT_0 + 0 <= ret && ret <= WAIT_OBJECT_0 + w->num - 1) {
             if (w->func[ret - WAIT_OBJECT_0])
                 w->func[ret - WAIT_OBJECT_0](w->opaque[ret - WAIT_OBJECT_0]);