Skip to contentSkip to conversation

w32: Add missing functions qemu_mutex_destroy, qemu_cond_destroy

PATCH Applied Stefan Weil 2 participants 3 messages Mar 13, 2011 – Mar 19, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 <[email protected]>
Cc Blue Swirl <[email protected]>
---
 qemu-thread-win32.c |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)
qemu-thread-win32.c +21 -0
index 2edcb1a..2d2d5ab 100644
@@ -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;
Signature · 1 line
1.7.2.3
#1 lore raw

Am 13.03.2011 19:00, schrieb Stefan Weil:

Quoted 42 lines

These functions were missing in commit 9257d46d55f1fe4e8209be9a6870e339ac3266fe.

Both functions are needed for compilations with configuration --enable-vnc-thread.

Cc Paolo Bonzini <[email protected]>
Cc Blue Swirl <[email protected]>

---
qemu-thread-win32.c | 21 +++++++++++++++++++++

1 files changed, 21 insertions(+), 0 deletions(-)
qemu-thread-win32.c +14 -0
index 2edcb1a..2d2d5ab 100644
@@ -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;

qemu-thread-win32.c void qemu_cond_init(QemuCond *cond) · line 106

Quoted 10 lines
qemu-thread-win32.c +7 -0
+ result = CloseHandle(cond->sema);
+ if (!result) {
+ error_exit(GetLastError(), __func__);
+ }
+ cond->sema = 0;
+}
+
 void qemu_cond_signal(QemuCond *cond)
 {
 DWORD result;

No comments? Why is is so difficult to get compilation problems fixed?

Applied
#2 lore raw

Thanks, applied.

Quoted 57 lines · Stefan Weil

Am 13.03.2011 19:00, schrieb Stefan Weil:

Quoted 43 lines

These functions were missing in commit 9257d46d55f1fe4e8209be9a6870e339ac3266fe.

Both functions are needed for compilations with configuration --enable-vnc-thread.

Cc Paolo Bonzini <[email protected]>
Cc Blue Swirl <[email protected]>

---
qemu-thread-win32.c | 21 +++++++++++++++++++++

1 files changed, 21 insertions(+), 0 deletions(-)
qemu-thread-win32.c +14 -0
index 2edcb1a..2d2d5ab 100644
@@ -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;

qemu-thread-win32.c void qemu_cond_init(QemuCond *cond) · line 106

Quoted 10 lines
qemu-thread-win32.c +7 -0
+ result = CloseHandle(cond->sema);
+ if (!result) {
+ error_exit(GetLastError(), __func__);
+ }
+ cond->sema = 0;
+}
+
 void qemu_cond_signal(QemuCond *cond)
 {
 DWORD result;

No comments? Why is is so difficult to get compilation problems fixed?