Kernel/Mutex: Update a mutex priority when a thread stops waiting on it.

This commit is contained in:
Subv 2017-01-02 13:53:10 -05:00
parent 7abf185390
commit b6a0355568
5 changed files with 42 additions and 24 deletions

View file

@ -373,8 +373,9 @@ static ResultCode WaitSynchronizationN(s32* out, Kernel::Handle* handles, s32 ha
return ERR_SYNC_TIMEOUT;
} else {
// Find the first object that is acquirable in the provided list of objects
auto itr = std::find_if(objects.begin(), objects.end(),
[thread](const ObjectPtr& object) { return !object->ShouldWait(thread); });
auto itr = std::find_if(objects.begin(), objects.end(), [thread](const ObjectPtr& object) {
return !object->ShouldWait(thread);
});
if (itr != objects.end()) {
// We found a ready object, acquire it and set the result value