summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2014-11-26 20:37:58 +0100
committerbunnei <bunneidev@gmail.com>2014-11-26 20:38:42 +0100
commita449e0e11af25b85dfa41c4d774b654637549689 (patch)
treedd82928ee40720287ca891627b8867fe356fa557 /src/core
parentMerge pull request #147 from yuriks/error-codes (diff)
downloadyuzu-a449e0e11af25b85dfa41c4d774b654637549689.tar
yuzu-a449e0e11af25b85dfa41c4d774b654637549689.tar.gz
yuzu-a449e0e11af25b85dfa41c4d774b654637549689.tar.bz2
yuzu-a449e0e11af25b85dfa41c4d774b654637549689.tar.lz
yuzu-a449e0e11af25b85dfa41c4d774b654637549689.tar.xz
yuzu-a449e0e11af25b85dfa41c4d774b654637549689.tar.zst
yuzu-a449e0e11af25b85dfa41c4d774b654637549689.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/kernel/mutex.cpp15
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;
}
/**