]> git.proxmox.com Git - mirror_qemu.git/blob - include/qemu/thread-win32.h
Merge remote-tracking branch 'remotes/kraxel/tags/ui-20180827-v4-pull-request' into...
[mirror_qemu.git] / include / qemu / thread-win32.h
1 #ifndef QEMU_THREAD_WIN32_H
2 #define QEMU_THREAD_WIN32_H
3
4 #include <windows.h>
5
6 struct QemuMutex {
7 SRWLOCK lock;
8 #ifdef CONFIG_DEBUG_MUTEX
9 const char *file;
10 int line;
11 #endif
12 bool initialized;
13 };
14
15 typedef struct QemuRecMutex QemuRecMutex;
16 struct QemuRecMutex {
17 CRITICAL_SECTION lock;
18 bool initialized;
19 };
20
21 void qemu_rec_mutex_destroy(QemuRecMutex *mutex);
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);
25 void qemu_rec_mutex_unlock(QemuRecMutex *mutex);
26
27 struct QemuCond {
28 CONDITION_VARIABLE var;
29 bool initialized;
30 };
31
32 struct QemuSemaphore {
33 HANDLE sema;
34 bool initialized;
35 };
36
37 struct QemuEvent {
38 int value;
39 HANDLE event;
40 bool initialized;
41 };
42
43 typedef struct QemuThreadData QemuThreadData;
44 struct QemuThread {
45 QemuThreadData *data;
46 unsigned tid;
47 };
48
49 /* Only valid for joinable threads. */
50 HANDLE qemu_thread_get_handle(QemuThread *thread);
51
52 #endif