diff options
| author | 2019-03-14 21:58:23 -0400 | |
|---|---|---|
| committer | 2019-03-15 23:02:14 -0400 | |
| commit | db47d7e4716effb1021be3ebdc90763c3a53cafc (patch) | |
| tree | fcdcf3d28b281aa6576badb61632ceb106e7b66a /src/core/hle/kernel/thread.cpp | |
| parent | kernel/thread: Make bracing consistent within UpdatePriority() (diff) | |
| download | yuzu-db47d7e4716effb1021be3ebdc90763c3a53cafc.tar.gz yuzu-db47d7e4716effb1021be3ebdc90763c3a53cafc.tar.xz yuzu-db47d7e4716effb1021be3ebdc90763c3a53cafc.zip | |
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().
Diffstat (limited to 'src/core/hle/kernel/thread.cpp')
| -rw-r--r-- | src/core/hle/kernel/thread.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
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> thread) { | |||
| 303 | } | 303 | } |
| 304 | 304 | ||
| 305 | void Thread::UpdatePriority() { | 305 | void Thread::UpdatePriority() { |
| 306 | // Find the highest priority among all the threads that are waiting for this thread's lock | 306 | // If any of the threads waiting on the mutex have a higher priority |
| 307 | // (taking into account priority inheritance), then this thread inherits | ||
| 308 | // that thread's priority. | ||
| 307 | u32 new_priority = nominal_priority; | 309 | u32 new_priority = nominal_priority; |
| 308 | if (!wait_mutex_threads.empty()) { | 310 | if (!wait_mutex_threads.empty()) { |
| 309 | if (wait_mutex_threads.front()->current_priority < new_priority) { | 311 | if (wait_mutex_threads.front()->current_priority < new_priority) { |