From db47d7e4716effb1021be3ebdc90763c3a53cafc Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 14 Mar 2019 21:58:23 -0400 Subject: kernel/thread: Expand documentation of nominal_priority and current_priority Aims to disambiguate why each priority instance exists a little bit. While we're at it, also add an explanatory comment to UpdatePriority(). --- src/core/hle/kernel/thread.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/core/hle/kernel/thread.cpp') diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index c5cee12dd..202997d20 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp @@ -303,7 +303,9 @@ void Thread::RemoveMutexWaiter(SharedPtr thread) { } void Thread::UpdatePriority() { - // Find the highest priority among all the threads that are waiting for this thread's lock + // If any of the threads waiting on the mutex have a higher priority + // (taking into account priority inheritance), then this thread inherits + // that thread's priority. u32 new_priority = nominal_priority; if (!wait_mutex_threads.empty()) { if (wait_mutex_threads.front()->current_priority < new_priority) { -- cgit v1.2.3