mirror of https://github.com/mgba-emu/mgba.git
Util: Allow disabling the threading code entirely
This commit is contained in:
parent
6530bfe94a
commit
3b29ba1aa2
1
CHANGES
1
CHANGES
|
@ -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:
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue