VERY experimental Nintendo Switch 2 emulator
C++
Mutex: Add the calling thread to the waiting list when needed
Subvea80363cc28e
diff --git a/src/core/hle/kernel/mutex.cpp b/src/core/hle/kernel/mutex.cppindex 558068c792..3dfeffc9bb 100644--- a/src/core/hle/kernel/mutex.cpp+++ b/src/core/hle/kernel/mutex.cpp@@ -168,9 +168,9 @@ Handle CreateMutex(bool initial_locked, const std::string& name) {ResultVal<bool> Mutex::WaitSynchronization() {bool wait = locked;if (locked) {+ waiting_threads.push_back(GetCurrentThreadHandle());Kernel::WaitCurrentThread(WAITTYPE_MUTEX, GetHandle());- }- else {+ } else {// Lock the mutex when the first thread accesses itlocked = true;MutexAcquireLock(this);