1 #ifndef _WIMLIB_THREADS_H
2 #define _WIMLIB_THREADS_H
10 void *(*thrproc)(void *);
14 struct mutex { void *win32_crit; };
15 #define MUTEX_INITIALIZER { NULL }
17 struct condvar { void *win32_cond; };
23 struct thread { pthread_t pthread; };
25 struct mutex { pthread_mutex_t pthread_mutex; };
26 #define MUTEX_INITIALIZER { PTHREAD_MUTEX_INITIALIZER }
28 struct condvar { pthread_cond_t pthread_cond; };
32 bool thread_create(struct thread *t, void *(*thrproc)(void *), void *arg);
33 void thread_join(struct thread *t);
34 bool mutex_init(struct mutex *m);
35 void mutex_destroy(struct mutex *m);
36 void mutex_lock(struct mutex *m);
37 void mutex_unlock(struct mutex *m);
38 bool condvar_init(struct condvar *c);
39 void condvar_destroy(struct condvar *c);
40 void condvar_wait(struct condvar *c, struct mutex *m);
41 void condvar_signal(struct condvar *c);
42 void condvar_broadcast(struct condvar *c);
44 #endif /* _WIMLIB_THREADS_H */