Kernel/Mutex: Propagate thread priority changes to other threads inheriting the priority via mutexes
This commit is contained in:
parent
b6a0355568
commit
d3ff5b91e1
5 changed files with 60 additions and 42 deletions
|
@ -611,6 +611,12 @@ static ResultCode SetThreadPriority(Kernel::Handle handle, s32 priority) {
|
|||
return ERR_INVALID_HANDLE;
|
||||
|
||||
thread->SetPriority(priority);
|
||||
thread->UpdatePriority();
|
||||
|
||||
// Update the mutexes that this thread is waiting for
|
||||
for (auto& mutex : thread->pending_mutexes)
|
||||
mutex->UpdatePriority();
|
||||
|
||||
Core::System::GetInstance().PrepareReschedule();
|
||||
return RESULT_SUCCESS;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue