]>
Commit | Line | Data |
---|---|---|
9257d46d PB |
1 | #ifndef __QEMU_THREAD_POSIX_H |
2 | #define __QEMU_THREAD_POSIX_H 1 | |
3 | #include "pthread.h" | |
38b14db3 | 4 | #include <semaphore.h> |
9257d46d PB |
5 | |
6 | struct QemuMutex { | |
7 | pthread_mutex_t lock; | |
8 | }; | |
9 | ||
10 | struct QemuCond { | |
11 | pthread_cond_t cond; | |
12 | }; | |
13 | ||
38b14db3 | 14 | struct QemuSemaphore { |
c166cb72 PB |
15 | #if defined(__OpenBSD__) || defined(__APPLE__) || defined(__NetBSD__) |
16 | pthread_mutex_t lock; | |
17 | pthread_cond_t cond; | |
18 | int count; | |
19 | #else | |
38b14db3 | 20 | sem_t sem; |
c166cb72 | 21 | #endif |
38b14db3 PB |
22 | }; |
23 | ||
9257d46d PB |
24 | struct QemuThread { |
25 | pthread_t thread; | |
26 | }; | |
27 | ||
9257d46d | 28 | #endif |