]>
Commit | Line | Data |
---|---|---|
2a6a4076 MA |
1 | #ifndef QEMU_THREAD_WIN32_H |
2 | #define QEMU_THREAD_WIN32_H | |
a9c94277 MA |
3 | |
4 | #include <windows.h> | |
9257d46d PB |
5 | |
6 | struct QemuMutex { | |
12f8def0 | 7 | SRWLOCK lock; |
ba59fb77 PB |
8 | #ifdef CONFIG_DEBUG_MUTEX |
9 | const char *file; | |
10 | int line; | |
11 | #endif | |
c096358e | 12 | bool initialized; |
9257d46d PB |
13 | }; |
14 | ||
feadec63 PB |
15 | typedef struct QemuRecMutex QemuRecMutex; |
16 | struct QemuRecMutex { | |
17 | CRITICAL_SECTION lock; | |
c096358e | 18 | bool initialized; |
feadec63 PB |
19 | }; |
20 | ||
21 | void qemu_rec_mutex_destroy(QemuRecMutex *mutex); | |
22 | void qemu_rec_mutex_lock(QemuRecMutex *mutex); | |
23 | int qemu_rec_mutex_trylock(QemuRecMutex *mutex); | |
24 | void qemu_rec_mutex_unlock(QemuRecMutex *mutex); | |
25 | ||
9257d46d | 26 | struct QemuCond { |
12f8def0 | 27 | CONDITION_VARIABLE var; |
c096358e | 28 | bool initialized; |
9257d46d PB |
29 | }; |
30 | ||
38b14db3 PB |
31 | struct QemuSemaphore { |
32 | HANDLE sema; | |
c096358e | 33 | bool initialized; |
38b14db3 PB |
34 | }; |
35 | ||
c7c4d063 | 36 | struct QemuEvent { |
7c9b2bf6 | 37 | int value; |
c7c4d063 | 38 | HANDLE event; |
c096358e | 39 | bool initialized; |
c7c4d063 PB |
40 | }; |
41 | ||
403e6331 | 42 | typedef struct QemuThreadData QemuThreadData; |
9257d46d | 43 | struct QemuThread { |
403e6331 PB |
44 | QemuThreadData *data; |
45 | unsigned tid; | |
9257d46d PB |
46 | }; |
47 | ||
1ecf47bf PB |
48 | /* Only valid for joinable threads. */ |
49 | HANDLE qemu_thread_get_handle(QemuThread *thread); | |
50 | ||
9257d46d | 51 | #endif |