mirror of https://github.com/mgba-emu/mgba.git
Switch: Fix threading-related crash on second launch
This commit is contained in:
parent
c2b6692ce2
commit
c5b686fce2
4
CHANGES
4
CHANGES
|
@ -1,3 +1,7 @@
|
|||
0.7.3: (Future)
|
||||
Other fixes:
|
||||
- Switch: Fix threading-related crash on second launch
|
||||
|
||||
0.7.2: (2019-05-25)
|
||||
Emulation fixes:
|
||||
- GB: Fix HALT when IE and IF unused bits are set (fixes mgba.io/i/1349)
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
typedef ThreadFunc ThreadEntry;
|
||||
typedef CondVar Condition;
|
||||
|
||||
#define ThreadJoin(T) ThreadJoinPtr(&T)
|
||||
|
||||
static inline int MutexInit(Mutex* mutex) {
|
||||
mutexInit(mutex);
|
||||
return 0;
|
||||
|
@ -71,12 +73,12 @@ static inline int ThreadCreate(Thread* thread, ThreadEntry entry, void* context)
|
|||
return threadStart(thread);
|
||||
}
|
||||
|
||||
static inline int ThreadJoin(Thread thread) {
|
||||
int res = threadWaitForExit(&thread);
|
||||
static inline int ThreadJoinPtr(Thread* thread) {
|
||||
int res = threadWaitForExit(thread);
|
||||
if(R_FAILED(res)) {
|
||||
return res;
|
||||
}
|
||||
return threadClose(&thread);
|
||||
return threadClose(thread);
|
||||
}
|
||||
|
||||
static inline void ThreadSetName(const char* name) {
|
||||
|
|
Loading…
Reference in New Issue