]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
Add THREADDISABLE define to make builds with whole threading system disabled.
authorvortex <vortex@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 9 Dec 2011 23:10:16 +0000 (23:10 +0000)
committervortex <vortex@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 9 Dec 2011 23:10:16 +0000 (23:10 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11609 d7cf8633-e32d-0410-b094-e92efae38249

thread.h
thread_sdl.c
thread_win.c

index 5ba9be8ffa166f49a190f676edabaf3fb02164e5..7f88d8b4324adf5fc722681b9de03412ecdb46f2 100644 (file)
--- a/thread.h
+++ b/thread.h
@@ -2,6 +2,7 @@
 
 // enable Sys_PrintfToTerminal calls on nearly every threading call
 //#define THREADDEBUG
+//#define THREADDISABLE
 // use recursive mutex (non-posix) extensions in thread_pthread
 #define THREADRECURSIVE
 
index 64006dbfb6242fbc1cb05a6c90fce7ac3461552e..b49069c3d55d36bb4e544b995042fb2257391374 100644 (file)
@@ -5,6 +5,9 @@
 
 int Thread_Init(void)
 {
+#ifdef THREADDISABLE
+       Con_Printf("Threading disabled in this build\n");
+#endif
        return 0;
 }
 
@@ -14,7 +17,11 @@ void Thread_Shutdown(void)
 
 qboolean Thread_HasThreads(void)
 {
+#ifdef THREADDISABLE
+       return false;
+#else
        return true;
+#endif
 }
 
 void *_Thread_CreateMutex(const char *filename, int fileline)
index 893e8306048ede60d060f24efbe3e5c9b8669a23..77fe939cd291de9f017daf5ccf3d4c615aea3b19 100644 (file)
@@ -4,6 +4,9 @@
 
 int Thread_Init(void)
 {
+#ifdef THREADDISABLE
+       Con_Printf("Threading disabled in this build\n");
+#endif
        return 0;
 }
 
@@ -13,7 +16,11 @@ void Thread_Shutdown(void)
 
 qboolean Thread_HasThreads(void)
 {
+#ifdef THREADDISABLE
+       return false;
+#else
        return true;
+#endif
 }
 
 void *_Thread_CreateMutex(const char *filename, int fileline)