1 #ifndef __QEMU_THREAD_H
2 #define __QEMU_THREAD_H 1
6 typedef struct QemuMutex QemuMutex
;
7 typedef struct QemuCond QemuCond
;
8 typedef struct QemuThread QemuThread
;
11 #include "qemu-thread-win32.h"
13 #include "qemu-thread-posix.h"
16 void qemu_mutex_init(QemuMutex
*mutex
);
17 void qemu_mutex_destroy(QemuMutex
*mutex
);
18 void qemu_mutex_lock(QemuMutex
*mutex
);
19 int qemu_mutex_trylock(QemuMutex
*mutex
);
20 void qemu_mutex_unlock(QemuMutex
*mutex
);
22 #define rcu_read_lock() do { } while (0)
23 #define rcu_read_unlock() do { } while (0)
25 void qemu_cond_init(QemuCond
*cond
);
26 void qemu_cond_destroy(QemuCond
*cond
);
29 * IMPORTANT: The implementation does not guarantee that pthread_cond_signal
30 * and pthread_cond_broadcast can be called except while the same mutex is
31 * held as in the corresponding pthread_cond_wait calls!
33 void qemu_cond_signal(QemuCond
*cond
);
34 void qemu_cond_broadcast(QemuCond
*cond
);
35 void qemu_cond_wait(QemuCond
*cond
, QemuMutex
*mutex
);
37 void qemu_thread_create(QemuThread
*thread
,
38 void *(*start_routine
)(void*),
40 void qemu_thread_get_self(QemuThread
*thread
);
41 int qemu_thread_is_self(QemuThread
*thread
);
42 void qemu_thread_exit(void *retval
);