unlock iothread during WaitForMultipleObjects
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
parent
913895ab96
commit
9931b2f4c7
|
@ -140,7 +140,9 @@ void os_host_main_loop_wait(int *timeout)
|
||||||
int err;
|
int err;
|
||||||
WaitObjects *w = &wait_objects;
|
WaitObjects *w = &wait_objects;
|
||||||
|
|
||||||
|
qemu_mutex_unlock_iothread();
|
||||||
ret = WaitForMultipleObjects(w->num, w->events, FALSE, *timeout);
|
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 (WAIT_OBJECT_0 + 0 <= ret && ret <= WAIT_OBJECT_0 + w->num - 1) {
|
||||||
if (w->func[ret - WAIT_OBJECT_0])
|
if (w->func[ret - WAIT_OBJECT_0])
|
||||||
w->func[ret - WAIT_OBJECT_0](w->opaque[ret - WAIT_OBJECT_0]);
|
w->func[ret - WAIT_OBJECT_0](w->opaque[ret - WAIT_OBJECT_0]);
|
||||||
|
|
Loading…
Reference in New Issue