]> git.xonotic.org Git - xonotic/darkplaces.git/blob - thread.h
added debug prints (enabled if you define THREADDEBUG) for debugging
[xonotic/darkplaces.git] / thread.h
1 #ifndef THREAD_H
2
3 //#define THREADDEBUG
4
5 #define Thread_CreateMutex() (_Thread_CreateMutex(__FILE__, __LINE__))
6 #define Thread_DestroyMutex(m) (_Thread_DestroyMutex(m, __FILE__, __LINE__))
7 #define Thread_LockMutex(m) (_Thread_LockMutex(m, __FILE__, __LINE__))
8 #define Thread_UnlockMutex(m) (_Thread_UnlockMutex(m, __FILE__, __LINE__))
9
10 int Thread_Init(void);
11 void Thread_Shutdown(void);
12 qboolean Thread_HasThreads(void);
13 void *_Thread_CreateMutex(const char *filename, int fileline);
14 void _Thread_DestroyMutex(void *mutex, const char *filename, int fileline);
15 int _Thread_LockMutex(void *mutex, const char *filename, int fileline);
16 int _Thread_UnlockMutex(void *mutex, const char *filename, int fileline);
17 void *Thread_CreateCond(void);
18 void Thread_DestroyCond(void *cond);
19 int Thread_CondSignal(void *cond);
20 int Thread_CondBroadcast(void *cond);
21 int Thread_CondWait(void *cond, void *mutex);
22 void *Thread_CreateThread(int (*fn)(void *), void *data);
23 int Thread_WaitThread(void *thread, int retval);
24
25 #endif
26