mirror of https://github.com/mgba-emu/mgba.git
Util: Add THREAD_EXIT macro
This commit is contained in:
parent
7d6a8a86a8
commit
bb6613888a
|
@ -12,6 +12,7 @@
|
|||
#include <malloc.h>
|
||||
|
||||
#define THREAD_ENTRY void
|
||||
#define THREAD_EXIT(RES) return
|
||||
typedef ThreadFunc ThreadEntry;
|
||||
|
||||
typedef LightLock Mutex;
|
||||
|
|
|
@ -20,6 +20,7 @@ CXX_GUARD_START
|
|||
|
||||
#define THREAD_ENTRY void*
|
||||
typedef THREAD_ENTRY (*ThreadEntry)(void*);
|
||||
#define THREAD_EXIT(RES) return RES
|
||||
|
||||
typedef pthread_t Thread;
|
||||
typedef pthread_mutex_t Mutex;
|
||||
|
|
|
@ -17,6 +17,7 @@ typedef struct {
|
|||
} Condition;
|
||||
#define THREAD_ENTRY int
|
||||
typedef THREAD_ENTRY (*ThreadEntry)(void*);
|
||||
#define THREAD_EXIT(RES) return RES
|
||||
|
||||
static inline int MutexInit(Mutex* mutex) {
|
||||
Mutex id = sceKernelCreateMutex("mutex", 0, 0, 0);
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include <switch.h>
|
||||
|
||||
#define THREAD_ENTRY void
|
||||
#define THREAD_EXIT(RES) return
|
||||
typedef ThreadFunc ThreadEntry;
|
||||
typedef CondVar Condition;
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include <windows.h>
|
||||
#define THREAD_ENTRY DWORD WINAPI
|
||||
typedef THREAD_ENTRY ThreadEntry(LPVOID);
|
||||
#define THREAD_EXIT(RES) return RES
|
||||
|
||||
typedef HANDLE Thread;
|
||||
typedef CRITICAL_SECTION Mutex;
|
||||
|
|
|
@ -176,7 +176,7 @@ THREAD_ENTRY _rewindThread(void* context) {
|
|||
rewindContext->ready = false;
|
||||
}
|
||||
MutexUnlock(&rewindContext->mutex);
|
||||
return 0;
|
||||
THREAD_EXIT(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -159,6 +159,7 @@ static THREAD_ENTRY _promptThread(void* context) {
|
|||
ConditionWait(&elbe->promptWrite, &elbe->promptMutex);
|
||||
}
|
||||
MutexUnlock(&elbe->promptMutex);
|
||||
THREAD_EXIT(0);
|
||||
}
|
||||
|
||||
static int CLIDebuggerEditLinePoll(struct CLIDebuggerBackend* be, int32_t timeoutMs) {
|
||||
|
|
|
@ -841,5 +841,6 @@ THREAD_ENTRY mGUIAutosaveThread(void* context) {
|
|||
}
|
||||
}
|
||||
MutexUnlock(&autosave->mutex);
|
||||
THREAD_EXIT(0);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -207,7 +207,7 @@ static THREAD_ENTRY _proxyThread(void* logger) {
|
|||
}
|
||||
}
|
||||
MutexUnlock(&proxyRenderer->mutex);
|
||||
return 0;
|
||||
THREAD_EXIT(0);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -129,7 +129,7 @@ static THREAD_ENTRY _audioThread(void* context) {
|
|||
sceAudioOutOutput(audioPort, buffer);
|
||||
}
|
||||
sceAudioOutReleasePort(audioPort);
|
||||
return 0;
|
||||
THREAD_EXIT(0);
|
||||
}
|
||||
|
||||
static void _sampleRotation(struct mRotationSource* source) {
|
||||
|
|
|
@ -1365,6 +1365,7 @@ static THREAD_ENTRY CInemaJob(void* context) {
|
|||
CIflush(&stream.err, stderr);
|
||||
StringListDeinit(&stream.err.lines);
|
||||
StringListDeinit(&stream.err.partial);
|
||||
THREAD_EXIT(0);
|
||||
}
|
||||
|
||||
void _log(struct mLogger* log, int category, enum mLogLevel level, const char* format, va_list args) {
|
||||
|
|
Loading…
Reference in New Issue