]>
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); | |
fe9959a2 EC |
22 | void qemu_rec_mutex_lock_impl(QemuRecMutex *mutex, const char *file, int line); |
23 | int qemu_rec_mutex_trylock_impl(QemuRecMutex *mutex, const char *file, | |
24 | int line); | |
feadec63 PB |
25 | void qemu_rec_mutex_unlock(QemuRecMutex *mutex); |
26 | ||
9257d46d | 27 | struct QemuCond { |
12f8def0 | 28 | CONDITION_VARIABLE var; |
c096358e | 29 | bool initialized; |
9257d46d PB |
30 | }; |
31 | ||
38b14db3 PB |
32 | struct QemuSemaphore { |
33 | HANDLE sema; | |
c096358e | 34 | bool initialized; |
38b14db3 PB |
35 | }; |
36 | ||
c7c4d063 | 37 | struct QemuEvent { |
7c9b2bf6 | 38 | int value; |
c7c4d063 | 39 | HANDLE event; |
c096358e | 40 | bool initialized; |
c7c4d063 PB |
41 | }; |
42 | ||
403e6331 | 43 | typedef struct QemuThreadData QemuThreadData; |
9257d46d | 44 | struct QemuThread { |
403e6331 PB |
45 | QemuThreadData *data; |
46 | unsigned tid; | |
9257d46d PB |
47 | }; |
48 | ||
1ecf47bf PB |
49 | /* Only valid for joinable threads. */ |
50 | HANDLE qemu_thread_get_handle(QemuThread *thread); | |
51 | ||
9257d46d | 52 | #endif |