38b14db34e
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>
23 lines
298 B
C
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
|