all repos — mgba @ bb74b60cd9033fe1dd4cf0607b379033902dfc4d

mGBA Game Boy Advance Emulator

Core: Fix possible video sync deadlock
Vicki Pfau vi@endrift.com
Fri, 27 Nov 2020 17:38:31 -0800
commit

bb74b60cd9033fe1dd4cf0607b379033902dfc4d

parent

39324749f2e22c5c081cfca79502f90c8cd853e7

1 files changed, 2 insertions(+), 1 deletions(-)

jump to
M src/core/sync.csrc/core/sync.c

@@ -49,11 +49,11 @@ return true;

} MutexLock(&sync->videoFrameMutex); - ConditionWake(&sync->videoFrameRequiredCond); if (!sync->videoFrameWait && !sync->videoFramePending) { return false; } if (sync->videoFrameWait) { + ConditionWake(&sync->videoFrameRequiredCond); if (ConditionWaitTimed(&sync->videoFrameAvailableCond, &sync->videoFrameMutex, 50)) { return false; }

@@ -67,6 +67,7 @@ if (!sync) {

return; } + ConditionWake(&sync->videoFrameRequiredCond); MutexUnlock(&sync->videoFrameMutex); }