GBA Thread: Wakeup audio condition if trying to interrupt the thread to avoid a deadlock

This commit is contained in:
Jeffrey Pfau 2014-11-08 03:49:20 -08:00
parent 7cdcdbd7b4
commit 190ea71646
1 changed files with 3 additions and 0 deletions

View File

@ -427,6 +427,9 @@ void GBAThreadJoin(struct GBAThread* threadContext) {
void GBAThreadInterrupt(struct GBAThread* threadContext) {
MutexLock(&threadContext->stateMutex);
threadContext->savedState = threadContext->state;
if (threadContext->sync.audioWait) {
ConditionWake(&threadContext->sync.audioRequiredCond);
}
_waitOnInterrupt(threadContext);
threadContext->state = THREAD_INTERRUPTING;
if (threadContext->debugger && threadContext->debugger->state == DEBUGGER_RUNNING) {