diff --git a/app/src/main/cpp/skyline/kernel/svc.cpp b/app/src/main/cpp/skyline/kernel/svc.cpp index 7fe8d0d2..752f3b0d 100644 --- a/app/src/main/cpp/skyline/kernel/svc.cpp +++ b/app/src/main/cpp/skyline/kernel/svc.cpp @@ -365,7 +365,7 @@ namespace skyline::kernel::svc { // If the new priority is equivalent to the current priority then we don't need to CAS newPriority = thread->priority.load(); newPriority = std::min(newPriority, priority); - } while (newPriority != priority && thread->priority.compare_exchange_strong(newPriority, priority)); + } while (newPriority != priority && !thread->priority.compare_exchange_strong(newPriority, priority)); state.scheduler->UpdatePriority(thread); thread->UpdatePriorityInheritance(); } diff --git a/app/src/main/cpp/skyline/kernel/types/KProcess.cpp b/app/src/main/cpp/skyline/kernel/types/KProcess.cpp index 885bc318..f6856789 100644 --- a/app/src/main/cpp/skyline/kernel/types/KProcess.cpp +++ b/app/src/main/cpp/skyline/kernel/types/KProcess.cpp @@ -181,7 +181,7 @@ namespace skyline::kernel::type { do { basePriority = state.thread->basePriority.load(); newPriority = std::min(basePriority, highestPriorityThread->priority.load()); - } while (basePriority != newPriority && state.thread->priority.compare_exchange_strong(basePriority, newPriority)); + } while (basePriority != newPriority && !state.thread->priority.compare_exchange_strong(basePriority, newPriority)); state.scheduler->UpdatePriority(state.thread); } else { i8 priority, basePriority; @@ -199,7 +199,7 @@ namespace skyline::kernel::type { do { ownerPriority = nextOwner->priority.load(); priority = std::min(ownerPriority, nextWaiter->priority.load()); - } while (ownerPriority != priority && nextOwner->priority.compare_exchange_strong(ownerPriority, priority)); + } while (ownerPriority != priority && !nextOwner->priority.compare_exchange_strong(ownerPriority, priority)); __atomic_store_n(mutex, nextOwner->waitTag | HandleWaitersBit, __ATOMIC_SEQ_CST); } else {