Revision 313b1d69

b/qemu-thread.c
34 34
        error_exit(err, __func__);
35 35
}
36 36

  
37
void qemu_mutex_destroy(QemuMutex *mutex)
38
{
39
    int err;
40

  
41
    err = pthread_mutex_destroy(&mutex->lock);
42
    if (err)
43
        error_exit(err, __func__);
44
}
45

  
37 46
void qemu_mutex_lock(QemuMutex *mutex)
38 47
{
39 48
    int err;
......
90 99
        error_exit(err, __func__);
91 100
}
92 101

  
102
void qemu_cond_destroy(QemuCond *cond)
103
{
104
    int err;
105

  
106
    err = pthread_cond_destroy(&cond->cond);
107
    if (err)
108
        error_exit(err, __func__);
109
}
110

  
93 111
void qemu_cond_signal(QemuCond *cond)
94 112
{
95 113
    int err;
......
168 186
   return pthread_equal(thread1->thread, thread2->thread);
169 187
}
170 188

  
189
void qemu_thread_exit(void *retval)
190
{
191
    pthread_exit(retval);
192
}
b/qemu-thread.h
20 20
typedef struct QemuThread QemuThread;
21 21

  
22 22
void qemu_mutex_init(QemuMutex *mutex);
23
void qemu_mutex_destroy(QemuMutex *mutex);
23 24
void qemu_mutex_lock(QemuMutex *mutex);
24 25
int qemu_mutex_trylock(QemuMutex *mutex);
25 26
int qemu_mutex_timedlock(QemuMutex *mutex, uint64_t msecs);
26 27
void qemu_mutex_unlock(QemuMutex *mutex);
27 28

  
28 29
void qemu_cond_init(QemuCond *cond);
30
void qemu_cond_destroy(QemuCond *cond);
29 31
void qemu_cond_signal(QemuCond *cond);
30 32
void qemu_cond_broadcast(QemuCond *cond);
31 33
void qemu_cond_wait(QemuCond *cond, QemuMutex *mutex);
......
37 39
void qemu_thread_signal(QemuThread *thread, int sig);
38 40
void qemu_thread_self(QemuThread *thread);
39 41
int qemu_thread_equal(QemuThread *thread1, QemuThread *thread2);
42
void qemu_thread_exit(void *retval);
43

  
40 44
#endif

Also available in: Unified diff