]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - thread.h
added debug prints (enabled if you define THREADDEBUG) for debugging
[xonotic/darkplaces.git] / thread.h
index 590da9771ff4a52f508554000ed49828ff928dfc..216f690668afa7d804ec3182e7b0df48ac90a3ac 100644 (file)
--- a/thread.h
+++ b/thread.h
@@ -1,12 +1,19 @@
 #ifndef THREAD_H
 
+//#define THREADDEBUG
+
+#define Thread_CreateMutex() (_Thread_CreateMutex(__FILE__, __LINE__))
+#define Thread_DestroyMutex(m) (_Thread_DestroyMutex(m, __FILE__, __LINE__))
+#define Thread_LockMutex(m) (_Thread_LockMutex(m, __FILE__, __LINE__))
+#define Thread_UnlockMutex(m) (_Thread_UnlockMutex(m, __FILE__, __LINE__))
+
 int Thread_Init(void);
 void Thread_Shutdown(void);
 qboolean Thread_HasThreads(void);
-void *Thread_CreateMutex(void);
-void Thread_DestroyMutex(void *mutex);
-int Thread_LockMutex(void *mutex);
-int Thread_UnlockMutex(void *mutex);
+void *_Thread_CreateMutex(const char *filename, int fileline);
+void _Thread_DestroyMutex(void *mutex, const char *filename, int fileline);
+int _Thread_LockMutex(void *mutex, const char *filename, int fileline);
+int _Thread_UnlockMutex(void *mutex, const char *filename, int fileline);
 void *Thread_CreateCond(void);
 void Thread_DestroyCond(void *cond);
 int Thread_CondSignal(void *cond);