diff options
author | bunnei <bunneidev@gmail.com> | 2014-11-26 14:37:58 -0500 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2014-11-26 14:38:42 -0500 |
commit | a449e0e11af25b85dfa41c4d774b654637549689 (patch) | |
tree | dd82928ee40720287ca891627b8867fe356fa557 /src | |
parent | bb730855e58d18d8964d158a55822c40503d548f (diff) |
Mutex: Changed behavior to always release mutex for all threads.
Diffstat (limited to 'src')
-rw-r--r-- | src/core/hle/kernel/mutex.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/core/hle/kernel/mutex.cpp b/src/core/hle/kernel/mutex.cpp index b303ba128..d07e9761b 100644 --- a/src/core/hle/kernel/mutex.cpp +++ b/src/core/hle/kernel/mutex.cpp @@ -88,20 +88,19 @@ bool ReleaseMutexForThread(Mutex* mutex, Handle thread) { bool ReleaseMutex(Mutex* mutex) { MutexEraseLock(mutex); - bool woke_threads = false; // Find the next waiting thread for the mutex... - while (!woke_threads && !mutex->waiting_threads.empty()) { + while (!mutex->waiting_threads.empty()) { std::vector<Handle>::iterator iter = mutex->waiting_threads.begin(); - woke_threads |= ReleaseMutexForThread(mutex, *iter); + ReleaseMutexForThread(mutex, *iter); mutex->waiting_threads.erase(iter); } + // Reset mutex lock thread handle, nothing is waiting - if (!woke_threads) { - mutex->locked = false; - mutex->lock_thread = -1; - } - return woke_threads; + mutex->locked = false; + mutex->lock_thread = -1; + + return true; } /** |