From b0cf9e63ac2bba7fd155b2bb53318fc85ef168d6 Mon Sep 17 00:00:00 2001 From: vortex Date: Fri, 9 Dec 2011 23:10:16 +0000 Subject: [PATCH] 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 --- thread.h | 1 + thread_sdl.c | 7 +++++++ thread_win.c | 7 +++++++ 3 files changed, 15 insertions(+) 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) -- 2.39.2