3 // enable Sys_PrintfToTerminal calls on nearly every threading call
5 // use recursive mutex (non-posix) extensions in thread_pthread
6 #define THREADRECURSIVE
8 #define Thread_CreateMutex() (_Thread_CreateMutex(__FILE__, __LINE__))
9 #define Thread_DestroyMutex(m) (_Thread_DestroyMutex(m, __FILE__, __LINE__))
10 #define Thread_LockMutex(m) (_Thread_LockMutex(m, __FILE__, __LINE__))
11 #define Thread_UnlockMutex(m) (_Thread_UnlockMutex(m, __FILE__, __LINE__))
12 #define Thread_CreateCond() (_Thread_CreateCond(__FILE__, __LINE__))
13 #define Thread_DestroyCond(cond) (_Thread_DestroyCond(cond, __FILE__, __LINE__))
14 #define Thread_CondSignal(cond) (_Thread_CondSignal(cond, __FILE__, __LINE__))
15 #define Thread_CondBroadcast(cond) (_Thread_CondBroadcast(cond, __FILE__, __LINE__))
16 #define Thread_CondWait(cond, mutex) (_Thread_CondWait(cond, mutex, __FILE__, __LINE__))
17 #define Thread_CreateThread(fn, data) (_Thread_CreateThread(fn, data, __FILE__, __LINE__))
18 #define Thread_WaitThread(thread, retval) (_Thread_WaitThread(thread, retval, __FILE__, __LINE__))
20 int Thread_Init(void);
21 void Thread_Shutdown(void);
22 qboolean Thread_HasThreads(void);
23 void *_Thread_CreateMutex(const char *filename, int fileline);
24 void _Thread_DestroyMutex(void *mutex, const char *filename, int fileline);
25 int _Thread_LockMutex(void *mutex, const char *filename, int fileline);
26 int _Thread_UnlockMutex(void *mutex, const char *filename, int fileline);
27 void *_Thread_CreateCond(const char *filename, int fileline);
28 void _Thread_DestroyCond(void *cond, const char *filename, int fileline);
29 int _Thread_CondSignal(void *cond, const char *filename, int fileline);
30 int _Thread_CondBroadcast(void *cond, const char *filename, int fileline);
31 int _Thread_CondWait(void *cond, void *mutex, const char *filename, int fileline);
32 void *_Thread_CreateThread(int (*fn)(void *), void *data, const char *filename, int fileline);
33 int _Thread_WaitThread(void *thread, int retval, const char *filename, int fileline);