Fix KThread Priority Inheritance CAS

The CAS condition for KThread PI was inverted which lead to entirely incorrect behavior for CAS conditions which while it might work in the vast majority of cases would lead to significantly inaccurate behavior.
This commit is contained in:
PixelyIon 2022-07-14 20:30:04 +05:30
parent 45cb8388cc
commit 284ac53d88
No known key found for this signature in database
GPG Key ID: 11BC6C3201BC2C05

View File

@ -284,7 +284,7 @@ namespace skyline::kernel::type {
ownerPriority = waitingOn->priority.load();
if (ownerPriority <= currentPriority)
return;
} while (waitingOn->priority.compare_exchange_strong(ownerPriority, currentPriority));
} while (!waitingOn->priority.compare_exchange_strong(ownerPriority, currentPriority));
if (ownerPriority != currentPriority) {
std::scoped_lock waiterLock{waitingOn->waiterMutex};