summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2019-03-15 02:47:46 +0100
committerLioncash <mathew1800@gmail.com>2019-03-16 04:01:43 +0100
commit39483b92b7046c36ee937d80a7342b9ec6bc1ec4 (patch)
tree3ac045824e8cea6d93d58e9a8827b936d265d8d7 /src/core
parentkernel/thread: Maintain priority ordering of added mutex waiting threads (diff)
downloadyuzu-39483b92b7046c36ee937d80a7342b9ec6bc1ec4.tar
yuzu-39483b92b7046c36ee937d80a7342b9ec6bc1ec4.tar.gz
yuzu-39483b92b7046c36ee937d80a7342b9ec6bc1ec4.tar.bz2
yuzu-39483b92b7046c36ee937d80a7342b9ec6bc1ec4.tar.lz
yuzu-39483b92b7046c36ee937d80a7342b9ec6bc1ec4.tar.xz
yuzu-39483b92b7046c36ee937d80a7342b9ec6bc1ec4.tar.zst
yuzu-39483b92b7046c36ee937d80a7342b9ec6bc1ec4.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/kernel/thread.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp
index 7706ca9e5..4b68b555f 100644
--- a/src/core/hle/kernel/thread.cpp
+++ b/src/core/hle/kernel/thread.cpp
@@ -305,9 +305,9 @@ void Thread::RemoveMutexWaiter(SharedPtr<Thread> thread) {
void Thread::UpdatePriority() {
// Find the highest priority among all the threads that are waiting for this thread's lock
u32 new_priority = nominal_priority;
- for (const auto& thread : wait_mutex_threads) {
- if (thread->nominal_priority < new_priority)
- new_priority = thread->nominal_priority;
+ if (!wait_mutex_threads.empty()) {
+ if (wait_mutex_threads.front()->current_priority < new_priority)
+ new_priority = wait_mutex_threads.front()->current_priority;
}
if (new_priority == current_priority)