2016-06-29 13:47:03 +02:00
|
|
|
#ifndef QEMU_THREAD_WIN32_H
|
|
|
|
#define QEMU_THREAD_WIN32_H
|
2016-06-22 19:11:19 +02:00
|
|
|
|
|
|
|
#include <windows.h>
|
2011-03-12 17:43:52 +01:00
|
|
|
|
|
|
|
struct QemuMutex {
|
2017-03-24 23:01:41 +01:00
|
|
|
SRWLOCK lock;
|
2018-06-13 14:23:08 +02:00
|
|
|
#ifdef CONFIG_DEBUG_MUTEX
|
|
|
|
const char *file;
|
|
|
|
int line;
|
|
|
|
#endif
|
2017-07-04 14:23:25 +02:00
|
|
|
bool initialized;
|
2011-03-12 17:43:52 +01:00
|
|
|
};
|
|
|
|
|
2016-10-27 12:49:07 +02:00
|
|
|
typedef struct QemuRecMutex QemuRecMutex;
|
|
|
|
struct QemuRecMutex {
|
|
|
|
CRITICAL_SECTION lock;
|
2017-07-04 14:23:25 +02:00
|
|
|
bool initialized;
|
2016-10-27 12:49:07 +02:00
|
|
|
};
|
|
|
|
|
2011-03-12 17:43:52 +01:00
|
|
|
struct QemuCond {
|
2017-03-24 23:01:41 +01:00
|
|
|
CONDITION_VARIABLE var;
|
2017-07-04 14:23:25 +02:00
|
|
|
bool initialized;
|
2011-03-12 17:43:52 +01:00
|
|
|
};
|
|
|
|
|
2011-08-08 14:36:41 +02:00
|
|
|
struct QemuSemaphore {
|
|
|
|
HANDLE sema;
|
2017-07-04 14:23:25 +02:00
|
|
|
bool initialized;
|
2011-08-08 14:36:41 +02:00
|
|
|
};
|
|
|
|
|
2013-09-25 08:20:59 +02:00
|
|
|
struct QemuEvent {
|
2015-08-12 15:38:18 +02:00
|
|
|
int value;
|
2013-09-25 08:20:59 +02:00
|
|
|
HANDLE event;
|
2017-07-04 14:23:25 +02:00
|
|
|
bool initialized;
|
2013-09-25 08:20:59 +02:00
|
|
|
};
|
|
|
|
|
2011-12-12 17:21:33 +01:00
|
|
|
typedef struct QemuThreadData QemuThreadData;
|
2011-03-12 17:43:52 +01:00
|
|
|
struct QemuThread {
|
2011-12-12 17:21:33 +01:00
|
|
|
QemuThreadData *data;
|
|
|
|
unsigned tid;
|
2011-03-12 17:43:52 +01:00
|
|
|
};
|
|
|
|
|
2011-12-13 13:43:52 +01:00
|
|
|
/* Only valid for joinable threads. */
|
2019-08-12 07:23:31 +02:00
|
|
|
HANDLE qemu_thread_get_handle(struct QemuThread *thread);
|
2011-12-13 13:43:52 +01:00
|
|
|
|
2011-03-12 17:43:52 +01:00
|
|
|
#endif
|