mirror of https://github.com/mgba-emu/mgba.git
GBA Thread: Dummy out threading functions, let GBASync* functions still be called
This commit is contained in:
parent
ed8852bbe0
commit
53023441da
|
@ -84,6 +84,7 @@ static void _pauseThread(struct GBAThread* threadContext, bool onThread) {
|
|||
_waitUntilNotState(threadContext, THREAD_PAUSING);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void _changeVideoSync(struct GBASync* sync, bool frameOn) {
|
||||
// Make sure the video thread can process events while the GBA thread is paused
|
||||
|
@ -95,6 +96,7 @@ static void _changeVideoSync(struct GBASync* sync, bool frameOn) {
|
|||
MutexUnlock(&sync->videoFrameMutex);
|
||||
}
|
||||
|
||||
#ifndef DISABLE_THREADING
|
||||
static THREAD_ENTRY _GBAThreadRun(void* context) {
|
||||
#ifdef USE_PTHREADS
|
||||
pthread_once(&_contextOnce, _createTLS);
|
||||
|
@ -534,7 +536,7 @@ struct GBAThread* GBAThreadGetContext(void) {
|
|||
pthread_once(&_contextOnce, _createTLS);
|
||||
return pthread_getspecific(_contextKey);
|
||||
}
|
||||
#else
|
||||
#elif _WIN32
|
||||
struct GBAThread* GBAThreadGetContext(void) {
|
||||
InitOnceExecuteOnce(&_contextOnce, _createTLS, NULL, 0);
|
||||
return TlsGetValue(_contextKey);
|
||||
|
@ -555,6 +557,12 @@ void GBAThreadTakeScreenshot(struct GBAThread* threadContext) {
|
|||
}
|
||||
#endif
|
||||
|
||||
#else
|
||||
struct GBAThread* GBAThreadGetContext(void) {
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
void GBASyncPostFrame(struct GBASync* sync) {
|
||||
if (!sync) {
|
||||
return;
|
||||
|
@ -651,4 +659,3 @@ void GBASyncConsumeAudio(struct GBASync* sync) {
|
|||
ConditionWake(&sync->audioRequiredCond);
|
||||
MutexUnlock(&sync->audioBufferMutex);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -126,6 +126,47 @@ static inline int ThreadJoin(Thread thread) {
|
|||
typedef void* Thread;
|
||||
typedef void* Mutex;
|
||||
typedef void* Condition;
|
||||
|
||||
static inline int MutexInit(Mutex* mutex) {
|
||||
UNUSED(mutex);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int MutexDeinit(Mutex* mutex) {
|
||||
UNUSED(mutex);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int MutexLock(Mutex* mutex) {
|
||||
UNUSED(mutex);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int MutexUnlock(Mutex* mutex) {
|
||||
UNUSED(mutex);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int ConditionInit(Condition* cond) {
|
||||
UNUSED(cond);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int ConditionDeinit(Condition* cond) {
|
||||
UNUSED(cond);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int ConditionWait(Condition* cond, Mutex* mutex) {
|
||||
UNUSED(cond);
|
||||
UNUSED(mutex);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int ConditionWake(Condition* cond) {
|
||||
UNUSED(cond);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue