1 #ifndef __QEMU_THREAD_H
2 #define __QEMU_THREAD_H 1
18 typedef struct QemuMutex QemuMutex
;
19 typedef struct QemuCond QemuCond
;
20 typedef struct QemuThread QemuThread
;
22 void qemu_mutex_init(QemuMutex
*mutex
);
23 void qemu_mutex_lock(QemuMutex
*mutex
);
24 int qemu_mutex_trylock(QemuMutex
*mutex
);
25 int qemu_mutex_timedlock(QemuMutex
*mutex
, uint64_t msecs
);
26 void qemu_mutex_unlock(QemuMutex
*mutex
);
28 void qemu_cond_init(QemuCond
*cond
);
29 void qemu_cond_signal(QemuCond
*cond
);
30 void qemu_cond_broadcast(QemuCond
*cond
);
31 void qemu_cond_wait(QemuCond
*cond
, QemuMutex
*mutex
);
32 int qemu_cond_timedwait(QemuCond
*cond
, QemuMutex
*mutex
, uint64_t msecs
);
34 void qemu_thread_create(QemuThread
*thread
,
35 void *(*start_routine
)(void*),
37 void qemu_thread_signal(QemuThread
*thread
, int sig
);
38 void qemu_thread_self(QemuThread
*thread
);
39 int qemu_thread_equal(QemuThread
*thread1
, QemuThread
*thread2
);