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
|
|
|
};
|
|
|
|
|
|
|
|
void qemu_rec_mutex_destroy(QemuRecMutex *mutex);
|
2017-08-08 19:53:15 +02:00
|
|
|
void qemu_rec_mutex_lock_impl(QemuRecMutex *mutex, const char *file, int line);
|
|
|
|
int qemu_rec_mutex_trylock_impl(QemuRecMutex *mutex, const char *file,
|
|
|
|
int line);
|
2016-10-27 12:49:07 +02:00
|
|
|
void qemu_rec_mutex_unlock(QemuRecMutex *mutex);
|
|
|
|
|
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. */
|
|
|
|
HANDLE qemu_thread_get_handle(QemuThread *thread);
|
|
|
|
|
2011-03-12 17:43:52 +01:00
|
|
|
#endif
|