From 95cf2909c115f4a09b727872ed3aa2225e03eced Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Thu, 30 Jan 2014 04:03:54 -0800 Subject: [PATCH] Unblock on audio when closing thread --- src/gba/gba-thread.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gba/gba-thread.c b/src/gba/gba-thread.c index 5aa4acd75..53bc5fe43 100644 --- a/src/gba/gba-thread.c +++ b/src/gba/gba-thread.c @@ -204,6 +204,10 @@ void GBAThreadEnd(struct GBAThread* threadContext) { } threadContext->state = THREAD_EXITING; MutexUnlock(&threadContext->stateMutex); + MutexLock(&threadContext->sync.audioBufferMutex); + threadContext->sync.audioWait = 0; + ConditionWake(&threadContext->sync.audioRequiredCond); + MutexUnlock(&threadContext->sync.audioBufferMutex); } void GBAThreadJoin(struct GBAThread* threadContext) {