12 #ifndef _HAVE_THREADID_TYPE
13 #define _HAVE_THREADID_TYPE
15 typedef DWORD threadid_t
;
17 typedef pthread_t threadid_t
;
21 #ifndef _HAVE_THREAD_TYPE
22 #define _HAVE_THREAD_TYPE
24 typedef struct thread_s
{
25 struct thread_s
*prev
;
26 struct thread_s
*next
;
40 #ifndef _HAVE_MUTEX_TYPE
41 #define _HAVE_MUTEX_TYPE
42 typedef struct mutex_s
{
46 pthread_mutexattr_t attr
;
56 /* defined in thread.c */
57 thread_t
*thread_create(void *(*func
)(), array_t
*args
);
58 void thread_free(thread_t
*t
);
59 void thread_exit(thread_t
*t
, int state
);
60 void thread_stop(thread_t
*t
);
61 int thread_wake(thread_t
*t
);
62 void thread_wait(thread_t
*t
);
63 threadid_t
thread_get_current_id(void);
64 mutex_t
*mutex_create(void);
65 void mutex_free(mutex_t
*m
);
66 void mutex_lock(mutex_t
*m
);
67 int mutex_trylock(mutex_t
*m
);
68 void mutex_unlock(mutex_t
*m
);
69 void mutex_unlock_complete(mutex_t
*m
);