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
93d3eaae1a
commit
a268eb7175
1
CHANGES
1
CHANGES
|
@ -4,6 +4,7 @@ Emulation fixes:
|
||||||
- GBA Memory: Mark Famicom Mini games 22 through 28 as non-mirroring
|
- GBA Memory: Mark Famicom Mini games 22 through 28 as non-mirroring
|
||||||
Other fixes:
|
Other fixes:
|
||||||
- CMake: Fix build with downstream minizip that exports incompatible symbols
|
- CMake: Fix build with downstream minizip that exports incompatible symbols
|
||||||
|
- Core: Fix thread unsafety issue when dispatching code to a thread
|
||||||
- Debugger: Close trace log when done tracing
|
- Debugger: Close trace log when done tracing
|
||||||
- Qt: Fix running proxied video if it gets pushed to the main thread
|
- Qt: Fix running proxied video if it gets pushed to the main thread
|
||||||
|
|
||||||
|
|
|
@ -260,7 +260,10 @@ static THREAD_ENTRY _mCoreThreadRun(void* context) {
|
||||||
if (threadContext->run) {
|
if (threadContext->run) {
|
||||||
threadContext->run(threadContext);
|
threadContext->run(threadContext);
|
||||||
}
|
}
|
||||||
|
MutexLock(&threadContext->impl->stateMutex);
|
||||||
threadContext->impl->state = threadContext->impl->savedState;
|
threadContext->impl->state = threadContext->impl->savedState;
|
||||||
|
ConditionWake(&threadContext->impl->stateCond);
|
||||||
|
MutexUnlock(&threadContext->impl->stateMutex);
|
||||||
break;
|
break;
|
||||||
case THREAD_RESETING:
|
case THREAD_RESETING:
|
||||||
core->reset(core);
|
core->reset(core);
|
||||||
|
|
Loading…
Reference in New Issue