]> git.proxmox.com Git - qemu.git/blame - qemu-thread.h
kvm: x86: Fail kvm_arch_init_vcpu if MCE initialization fails
[qemu.git] / qemu-thread.h
CommitLineData
e5d355d1
AL
1#ifndef __QEMU_THREAD_H
2#define __QEMU_THREAD_H 1
e5d355d1
AL
3
4typedef struct QemuMutex QemuMutex;
5typedef struct QemuCond QemuCond;
6typedef struct QemuThread QemuThread;
7
9257d46d
PB
8#ifdef _WIN32
9#include "qemu-thread-win32.h"
10#else
11#include "qemu-thread-posix.h"
12#endif
13
e5d355d1 14void qemu_mutex_init(QemuMutex *mutex);
313b1d69 15void qemu_mutex_destroy(QemuMutex *mutex);
e5d355d1
AL
16void qemu_mutex_lock(QemuMutex *mutex);
17int qemu_mutex_trylock(QemuMutex *mutex);
18int qemu_mutex_timedlock(QemuMutex *mutex, uint64_t msecs);
19void qemu_mutex_unlock(QemuMutex *mutex);
20
21void qemu_cond_init(QemuCond *cond);
313b1d69 22void qemu_cond_destroy(QemuCond *cond);
9257d46d
PB
23
24/*
25 * IMPORTANT: The implementation does not guarantee that pthread_cond_signal
26 * and pthread_cond_broadcast can be called except while the same mutex is
27 * held as in the corresponding pthread_cond_wait calls!
28 */
e5d355d1
AL
29void qemu_cond_signal(QemuCond *cond);
30void qemu_cond_broadcast(QemuCond *cond);
31void qemu_cond_wait(QemuCond *cond, QemuMutex *mutex);
32int qemu_cond_timedwait(QemuCond *cond, QemuMutex *mutex, uint64_t msecs);
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