Always set forceYield for running threads in PauseThread

`forceYield` was incorrectly not set when pausing running threads if the thread already had `pendingYield` set. This could lead to cases where `Rotate` would later throw an exception due to it being unset.
This commit is contained in:
PixelyIon 2022-11-30 02:52:52 +05:30 committed by Mark Collins
parent 6645692288
commit 8b973a3de3

View File

@ -379,10 +379,12 @@ namespace skyline::kernel {
if (it == core->queue.begin() && it != core->queue.end()) if (it == core->queue.begin() && it != core->queue.end())
(*it)->scheduleCondition.notify_one(); (*it)->scheduleCondition.notify_one();
if (it == core->queue.begin() && !thread->pendingYield) { if (it == core->queue.begin()) {
// We need to send a yield signal to the thread if it's currently running // We need to send a yield signal to the thread if it's currently running
if (!thread->pendingYield) {
thread->SendSignal(YieldSignal); thread->SendSignal(YieldSignal);
thread->pendingYield = true; thread->pendingYield = true;
}
thread->forceYield = true; thread->forceYield = true;
} }
} else { } else {