qemu/qemu-thread-posix.h
Paolo Bonzini 38b14db34e 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 <pbonzini@redhat.com>
2012-10-31 09:45:47 +01:00

23 lines
298 B
C

#ifndef __QEMU_THREAD_POSIX_H
#define __QEMU_THREAD_POSIX_H 1
#include "pthread.h"
#include <semaphore.h>
struct QemuMutex {
pthread_mutex_t lock;
};
struct QemuCond {
pthread_cond_t cond;
};
struct QemuSemaphore {
sem_t sem;
};
struct QemuThread {
pthread_t thread;
};
#endif