mirror of https://github.com/mgba-emu/mgba.git
Core: Fix thread unsafety issue when dispatching code to a thread
This commit is contained in:
parent
89937d62b0
commit
1c2ec714e1
1
CHANGES
1
CHANGES
|
@ -49,6 +49,7 @@ Other fixes:
|
|||
- CMake: Fix build with downstream minizip that exports incompatible symbols
|
||||
- Core: Ensure ELF regions can be written before trying
|
||||
- Core: Fix threading improperly setting paused state while interrupted
|
||||
- Core: Fix thread unsafety issue when dispatching code to a thread
|
||||
- Debugger: Don't skip undefined instructions when debugger attached
|
||||
- Debugger: Close trace log when done tracing
|
||||
- FFmpeg: Fix some small memory leaks
|
||||
|
|
|
@ -267,7 +267,10 @@ static THREAD_ENTRY _mCoreThreadRun(void* context) {
|
|||
if (threadContext->run) {
|
||||
threadContext->run(threadContext);
|
||||
}
|
||||
MutexLock(&threadContext->impl->stateMutex);
|
||||
threadContext->impl->state = threadContext->impl->savedState;
|
||||
ConditionWake(&threadContext->impl->stateCond);
|
||||
MutexUnlock(&threadContext->impl->stateMutex);
|
||||
break;
|
||||
case THREAD_RESETING:
|
||||
core->reset(core);
|
||||
|
|
Loading…
Reference in New Issue