Scheduler: Add protections for Yield bombing

In case of redundant yields, the scheduler will now idle the core for 
it's timeslice, in order to avoid continuously yielding the same thing 
over and over.
This commit is contained in:
Fernando Sahmkow 2019-09-10 10:23:43 -04:00 committed by FernandoS27
parent 82218c925a
commit 103f3a2fe5
5 changed files with 31 additions and 24 deletions

View file

@ -408,13 +408,13 @@ public:
void Sleep(s64 nanoseconds);
/// Yields this thread without rebalancing loads.
void YieldSimple();
bool YieldSimple();
/// Yields this thread and does a load rebalancing.
void YieldAndBalanceLoad();
bool YieldAndBalanceLoad();
/// Yields this thread and if the core is left idle, loads are rebalanced
void YieldAndWaitForLoadBalancing();
bool YieldAndWaitForLoadBalancing();
ThreadSchedStatus GetSchedulingStatus() const {
return static_cast<ThreadSchedStatus>(scheduling_state & ThreadSchedMasks::LowMask);