Util: Allow disabling the threading code entirely

This commit is contained in:
Jeffrey Pfau 2015-06-03 20:37:45 -07:00
parent 6530bfe94a
commit 3b29ba1aa2
3 changed files with 6 additions and 1 deletions

View File

@ -58,6 +58,7 @@ Misc:
- Qt: Only hide cursor in full screen
- Perf: Ability to load savestates immediately on launch
- Qt: Replace pause-after-frame mutex with an atomic
- Util: Allow disabling the threading code entirely
0.2.1: (2015-05-13)
Bugfixes:

View File

@ -25,6 +25,7 @@
static const float _defaultFPSTarget = 60.f;
#ifndef DISABLE_THREADING
#ifdef USE_PTHREADS
static pthread_key_t _contextKey;
static pthread_once_t _contextOnce = PTHREAD_ONCE_INIT;
@ -45,7 +46,6 @@ static BOOL CALLBACK _createTLS(PINIT_ONCE once, PVOID param, PVOID* context) {
}
#endif
#ifndef DISABLE_THREADING
static void _changeState(struct GBAThread* threadContext, enum ThreadState newState, bool broadcast) {
MutexLock(&threadContext->stateMutex);
threadContext->state = newState;

View File

@ -8,6 +8,7 @@
#include "util/common.h"
#ifndef DISABLE_THREADING
#ifdef USE_PTHREADS
#include <pthread.h>
#include <sys/time.h>
@ -144,6 +145,9 @@ static inline int ThreadJoin(Thread thread) {
}
#else
#define DISABLE_THREADING
#endif
#endif
#ifdef DISABLE_THREADING
typedef void* Thread;
typedef void* Mutex;
typedef void* Condition;