mirror of https://github.com/mgba-emu/mgba.git
Core: Fix race condition initializing thread proxy
This commit is contained in:
parent
b922cecc61
commit
d270a42de8
1
CHANGES
1
CHANGES
|
@ -14,6 +14,7 @@ Emulation fixes:
|
||||||
- GBA Video: Fix backdrop blending on lines without sprites (fixes mgba.io/i/1647)
|
- GBA Video: Fix backdrop blending on lines without sprites (fixes mgba.io/i/1647)
|
||||||
- GBA Video: Fix OpenGL sprite flag priority
|
- GBA Video: Fix OpenGL sprite flag priority
|
||||||
Other fixes:
|
Other fixes:
|
||||||
|
- Core: Fix race condition initializing thread proxy
|
||||||
- Qt: Only dynamically reset video scale if a game is running
|
- Qt: Only dynamically reset video scale if a game is running
|
||||||
- Qt: Fix race condition with proxied video events
|
- Qt: Fix race condition with proxied video events
|
||||||
- Qt: Force OpenGL paint engine creation thread (fixes mgba.io/i/1642)
|
- Qt: Force OpenGL paint engine creation thread (fixes mgba.io/i/1642)
|
||||||
|
|
|
@ -137,8 +137,10 @@ static void _postEvent(struct mVideoLogger* logger, enum mVideoLoggerEvent event
|
||||||
struct mVideoThreadProxy* proxyRenderer = (struct mVideoThreadProxy*) logger;
|
struct mVideoThreadProxy* proxyRenderer = (struct mVideoThreadProxy*) logger;
|
||||||
MutexLock(&proxyRenderer->mutex);
|
MutexLock(&proxyRenderer->mutex);
|
||||||
proxyRenderer->event = event;
|
proxyRenderer->event = event;
|
||||||
|
while (proxyRenderer->event) {
|
||||||
ConditionWake(&proxyRenderer->toThreadCond);
|
ConditionWake(&proxyRenderer->toThreadCond);
|
||||||
ConditionWait(&proxyRenderer->fromThreadCond, &proxyRenderer->mutex);
|
ConditionWait(&proxyRenderer->fromThreadCond, &proxyRenderer->mutex);
|
||||||
|
}
|
||||||
MutexUnlock(&proxyRenderer->mutex);
|
MutexUnlock(&proxyRenderer->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -179,6 +181,7 @@ static THREAD_ENTRY _proxyThread(void* logger) {
|
||||||
ThreadSetName("Proxy Renderer Thread");
|
ThreadSetName("Proxy Renderer Thread");
|
||||||
|
|
||||||
MutexLock(&proxyRenderer->mutex);
|
MutexLock(&proxyRenderer->mutex);
|
||||||
|
ConditionWake(&proxyRenderer->fromThreadCond);
|
||||||
while (proxyRenderer->threadState != PROXY_THREAD_STOPPED) {
|
while (proxyRenderer->threadState != PROXY_THREAD_STOPPED) {
|
||||||
ConditionWait(&proxyRenderer->toThreadCond, &proxyRenderer->mutex);
|
ConditionWait(&proxyRenderer->toThreadCond, &proxyRenderer->mutex);
|
||||||
if (proxyRenderer->threadState == PROXY_THREAD_STOPPED) {
|
if (proxyRenderer->threadState == PROXY_THREAD_STOPPED) {
|
||||||
|
|
Loading…
Reference in New Issue