From 1a290aea8dd25bd8a6d0edb945b120ea26fc05e0 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sun, 13 Mar 2011 19:00:52 +0100 Subject: w32: Add missing functions qemu_mutex_destroy, qemu_cond_destroy These functions were missing in commit 9257d46d55f1fe4e8209be9a6870e339ac3266fe. Both functions are needed for compilations with configuration --enable-vnc-thread. Cc: Paolo Bonzini Cc: Blue Swirl Signed-off-by: Stefan Weil Signed-off-by: Blue Swirl --- qemu-thread-win32.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/qemu-thread-win32.c b/qemu-thread-win32.c index 2edcb1a077..2d2d5abe39 100644 --- a/qemu-thread-win32.c +++ b/qemu-thread-win32.c @@ -33,6 +33,12 @@ void qemu_mutex_init(QemuMutex *mutex) InitializeCriticalSection(&mutex->lock); } +void qemu_mutex_destroy(QemuMutex *mutex) +{ + assert(mutex->owner == 0); + DeleteCriticalSection(&mutex->lock); +} + void qemu_mutex_lock(QemuMutex *mutex) { EnterCriticalSection(&mutex->lock); @@ -80,6 +86,21 @@ void qemu_cond_init(QemuCond *cond) } } +void qemu_cond_destroy(QemuCond *cond) +{ + BOOL result; + result = CloseHandle(cond->continue_event); + if (!result) { + error_exit(GetLastError(), __func__); + } + cond->continue_event = 0; + result = CloseHandle(cond->sema); + if (!result) { + error_exit(GetLastError(), __func__); + } + cond->sema = 0; +} + void qemu_cond_signal(QemuCond *cond) { DWORD result; -- cgit v1.2.1