1#ifndef QEMU_THREAD_WIN32_H 2#define QEMU_THREAD_WIN32_H 3 4#include <windows.h> 5 6struct QemuMutex { 7 SRWLOCK lock; 8#ifdef CONFIG_DEBUG_MUTEX 9 const char *file; 10 int line; 11#endif 12 bool initialized; 13}; 14 15typedef struct QemuRecMutex QemuRecMutex; 16struct QemuRecMutex { 17 CRITICAL_SECTION lock; 18 bool initialized; 19}; 20 21void qemu_rec_mutex_destroy(QemuRecMutex *mutex); 22void qemu_rec_mutex_lock_impl(QemuRecMutex *mutex, const char *file, int line); 23int qemu_rec_mutex_trylock_impl(QemuRecMutex *mutex, const char *file, 24 int line); 25void qemu_rec_mutex_unlock(QemuRecMutex *mutex); 26 27struct QemuCond { 28 CONDITION_VARIABLE var; 29 bool initialized; 30}; 31 32struct QemuSemaphore { 33 HANDLE sema; 34 bool initialized; 35}; 36 37struct QemuEvent { 38 int value; 39 HANDLE event; 40 bool initialized; 41}; 42 43typedef struct QemuThreadData QemuThreadData; 44struct QemuThread { 45 QemuThreadData *data; 46 unsigned tid; 47}; 48 49/* Only valid for joinable threads. */ 50HANDLE qemu_thread_get_handle(struct QemuThread *thread); 51 52#endif 53