From: vortex Date: Fri, 9 Dec 2011 23:10:16 +0000 (+0000) Subject: Add THREADDISABLE define to make builds with whole threading system disabled. X-Git-Tag: xonotic-v0.6.0~102^2~10 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=b0cf9e63ac2bba7fd155b2bb53318fc85ef168d6;p=xonotic%2Fdarkplaces.git Add THREADDISABLE define to make builds with whole threading system disabled. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11609 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/thread.h b/thread.h index 5ba9be8f..7f88d8b4 100644 --- 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 diff --git a/thread_sdl.c b/thread_sdl.c index 64006dbf..b49069c3 100644 --- a/thread_sdl.c +++ b/thread_sdl.c @@ -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) diff --git a/thread_win.c b/thread_win.c index 893e8306..77fe939c 100644 --- a/thread_win.c +++ b/thread_win.c @@ -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)