kernel: Fix svcWaitSynch to always acquire requested wait objects.

This commit is contained in:
bunnei 2015-06-07 23:39:37 -04:00
parent f1ff0fbf07
commit 71e8822d23
9 changed files with 68 additions and 113 deletions

View file

@ -23,12 +23,7 @@ static void ResumeWaitingThread(Mutex* mutex) {
// Reset mutex lock thread handle, nothing is waiting
mutex->lock_count = 0;
mutex->holding_thread = nullptr;
// Find the next waiting thread for the mutex...
auto next_thread = mutex->WakeupNextThread();
if (next_thread != nullptr) {
mutex->Acquire(next_thread);
}
mutex->WakeupAllWaitingThreads();
}
void ReleaseThreadMutexes(Thread* thread) {
@ -94,8 +89,6 @@ void Mutex::Release() {
ResumeWaitingThread(this);
}
}
HLE::Reschedule(__func__);
}
} // namespace