summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2014-11-30 14:47:49 +0100
committerbunnei <bunneidev@gmail.com>2014-11-30 14:47:49 +0100
commite3d1ffff4be6312ef2f25321cf4100748a7cd0b2 (patch)
tree7db418f0f4f275110f69861c2c228279d92d24fa /src/core/hle/kernel
parentMerge pull request #226 from bunnei/svc-and-thread-fixes (diff)
parentMutex: Changed behavior to always release mutex for all threads. (diff)
downloadyuzu-e3d1ffff4be6312ef2f25321cf4100748a7cd0b2.tar
yuzu-e3d1ffff4be6312ef2f25321cf4100748a7cd0b2.tar.gz
yuzu-e3d1ffff4be6312ef2f25321cf4100748a7cd0b2.tar.bz2
yuzu-e3d1ffff4be6312ef2f25321cf4100748a7cd0b2.tar.lz
yuzu-e3d1ffff4be6312ef2f25321cf4100748a7cd0b2.tar.xz
yuzu-e3d1ffff4be6312ef2f25321cf4100748a7cd0b2.tar.zst
yuzu-e3d1ffff4be6312ef2f25321cf4100748a7cd0b2.zip
Diffstat (limited to 'src/core/hle/kernel')
-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;
}
/**