diff options
| author | bunnei <bunneidev@gmail.com> | 2014-11-30 08:47:49 -0500 | 
|---|---|---|
| committer | bunnei <bunneidev@gmail.com> | 2014-11-30 08:47:49 -0500 | 
| commit | e3d1ffff4be6312ef2f25321cf4100748a7cd0b2 (patch) | |
| tree | 7db418f0f4f275110f69861c2c228279d92d24fa /src/core/hle | |
| parent | a5afad09378dab8978e8e4149337aebf70891668 (diff) | |
| parent | a449e0e11af25b85dfa41c4d774b654637549689 (diff) | |
Merge pull request #225 from bunnei/fix-release-mutex
Mutex: Changed behavior to always release mutex for all threads.
Diffstat (limited to 'src/core/hle')
| -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;  }  /** | 
