summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/mutex.cpp
diff options
context:
space:
mode:
authorGravatar Subv2015-01-04 12:52:34 -0500
committerGravatar Subv2015-01-04 12:52:34 -0500
commitea80363cc28e169ef3fe65918435b95ba945cc36 (patch)
tree344927a3add5f1148cbb602c3461460b2c055336 /src/core/hle/kernel/mutex.cpp
parentMerge pull request #403 from yuriks/shutdown-system (diff)
downloadyuzu-ea80363cc28e169ef3fe65918435b95ba945cc36.tar.gz
yuzu-ea80363cc28e169ef3fe65918435b95ba945cc36.tar.xz
yuzu-ea80363cc28e169ef3fe65918435b95ba945cc36.zip
Mutex: Add the calling thread to the waiting list when needed
This will happen when the mutex is already owned by another thread. Should fix some issues with games being stuck due to waiting threads not being awoken.
Diffstat (limited to 'src/core/hle/kernel/mutex.cpp')
-rw-r--r--src/core/hle/kernel/mutex.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/hle/kernel/mutex.cpp b/src/core/hle/kernel/mutex.cpp
index 558068c79..3dfeffc9b 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) {
168ResultVal<bool> Mutex::WaitSynchronization() { 168ResultVal<bool> Mutex::WaitSynchronization() {
169 bool wait = locked; 169 bool wait = locked;
170 if (locked) { 170 if (locked) {
171 waiting_threads.push_back(GetCurrentThreadHandle());
171 Kernel::WaitCurrentThread(WAITTYPE_MUTEX, GetHandle()); 172 Kernel::WaitCurrentThread(WAITTYPE_MUTEX, GetHandle());
172 } 173 } else {
173 else {
174 // Lock the mutex when the first thread accesses it 174 // Lock the mutex when the first thread accesses it
175 locked = true; 175 locked = true;
176 MutexAcquireLock(this); 176 MutexAcquireLock(this);