]> git.proxmox.com Git - qemu.git/blame - qemu-thread.h
simpletrace: suppress a warning from unused variable
[qemu.git] / qemu-thread.h
CommitLineData
e5d355d1
AL
1#ifndef __QEMU_THREAD_H
2#define __QEMU_THREAD_H 1
e5d355d1 3
65097429
AL
4#include <inttypes.h>
5
e5d355d1
AL
6typedef struct QemuMutex QemuMutex;
7typedef struct QemuCond QemuCond;
8typedef struct QemuThread QemuThread;
9
9257d46d
PB
10#ifdef _WIN32
11#include "qemu-thread-win32.h"
12#else
13#include "qemu-thread-posix.h"
14#endif
15
e5d355d1 16void qemu_mutex_init(QemuMutex *mutex);
313b1d69 17void qemu_mutex_destroy(QemuMutex *mutex);
e5d355d1
AL
18void qemu_mutex_lock(QemuMutex *mutex);
19int qemu_mutex_trylock(QemuMutex *mutex);
e5d355d1
AL
20void qemu_mutex_unlock(QemuMutex *mutex);
21
22void qemu_cond_init(QemuCond *cond);
313b1d69 23void qemu_cond_destroy(QemuCond *cond);
9257d46d
PB
24
25/*
26 * IMPORTANT: The implementation does not guarantee that pthread_cond_signal
27 * and pthread_cond_broadcast can be called except while the same mutex is
28 * held as in the corresponding pthread_cond_wait calls!
29 */
e5d355d1
AL
30void qemu_cond_signal(QemuCond *cond);
31void qemu_cond_broadcast(QemuCond *cond);
32void qemu_cond_wait(QemuCond *cond, QemuMutex *mutex);
e5d355d1
AL
33
34void qemu_thread_create(QemuThread *thread,
35 void *(*start_routine)(void*),
36 void *arg);
b7680cb6
JK
37void qemu_thread_get_self(QemuThread *thread);
38int qemu_thread_is_self(QemuThread *thread);
313b1d69
CC
39void qemu_thread_exit(void *retval);
40
e5d355d1 41#endif