From 38b14db34e16bb0ae1f28b7ddccb6aa11a2a96a1 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Mon, 8 Aug 2011 14:36:41 +0200 Subject: qemu-thread: add QemuSemaphore The new thread pool will use semaphores instead of condition variables, because QemuCond does not have qemu_cond_timedwait. (I also like it more this way). Signed-off-by: Paolo Bonzini --- qemu-thread-posix.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'qemu-thread-posix.h') diff --git a/qemu-thread-posix.h b/qemu-thread-posix.h index ee4618e620..2542c15200 100644 --- a/qemu-thread-posix.h +++ b/qemu-thread-posix.h @@ -1,6 +1,7 @@ #ifndef __QEMU_THREAD_POSIX_H #define __QEMU_THREAD_POSIX_H 1 #include "pthread.h" +#include struct QemuMutex { pthread_mutex_t lock; @@ -10,6 +11,10 @@ struct QemuCond { pthread_cond_t cond; }; +struct QemuSemaphore { + sem_t sem; +}; + struct QemuThread { pthread_t thread; }; -- cgit v1.2.3