diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/kernel/thread.cpp | 4 | ||||
| -rw-r--r-- | src/core/hle/kernel/thread.h | 10 |
2 files changed, 11 insertions, 3 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) { |
diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h index c48b21aba..96d9982d8 100644 --- a/src/core/hle/kernel/thread.h +++ b/src/core/hle/kernel/thread.h | |||
| @@ -398,8 +398,14 @@ private: | |||
| 398 | VAddr entry_point = 0; | 398 | VAddr entry_point = 0; |
| 399 | VAddr stack_top = 0; | 399 | VAddr stack_top = 0; |
| 400 | 400 | ||
| 401 | u32 nominal_priority = 0; ///< Nominal thread priority, as set by the emulated application | 401 | /// Nominal thread priority, as set by the emulated application. |
| 402 | u32 current_priority = 0; ///< Current thread priority, can be temporarily changed | 402 | /// The nominal priority is the thread priority without priority |
| 403 | /// inheritance taken into account. | ||
| 404 | u32 nominal_priority = 0; | ||
| 405 | |||
| 406 | /// Current thread priority. This may change over the course of the | ||
| 407 | /// thread's lifetime in order to facilitate priority inheritance. | ||
| 408 | u32 current_priority = 0; | ||
| 403 | 409 | ||
| 404 | u64 total_cpu_time_ticks = 0; ///< Total CPU running ticks. | 410 | u64 total_cpu_time_ticks = 0; ///< Total CPU running ticks. |
| 405 | u64 last_running_ticks = 0; ///< CPU tick when thread was last running | 411 | u64 last_running_ticks = 0; ///< CPU tick when thread was last running |