diff options
author | Subv <subv2112@gmail.com> | 2015-01-04 12:52:34 -0500 |
---|---|---|
committer | Subv <subv2112@gmail.com> | 2015-01-04 12:52:34 -0500 |
commit | ea80363cc28e169ef3fe65918435b95ba945cc36 (patch) | |
tree | 344927a3add5f1148cbb602c3461460b2c055336 /src/core/hle/kernel | |
parent | b058ce6feb28c8de9f7d1477c4b40175598c6791 (diff) |
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')
-rw-r--r-- | src/core/hle/kernel/mutex.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/hle/kernel/mutex.cpp b/src/core/hle/kernel/mutex.cpp index 558068c7..3dfeffc9 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 it locked = true; MutexAcquireLock(this); |