Core: Address Feedback

This commit is contained in:
Fernando Sahmkow
2020-02-13 17:01:44 -04:00
committed by FernandoS27
parent 1e6f8aba04
commit 2bc949628d
6 changed files with 50 additions and 24 deletions

View File

@ -125,7 +125,7 @@ bool GlobalScheduler::YieldThreadAndBalanceLoad(Thread* yielding_thread) {
scheduled_queue[core_id].yield(priority);
std::array<Thread*, Core::Hardware::NUM_CPU_CORES> current_threads;
for (u32 i = 0; i < Core::Hardware::NUM_CPU_CORES; i++) {
for (std::size_t i = 0; i < current_threads.size(); i++) {
current_threads[i] = scheduled_queue[i].empty() ? nullptr : scheduled_queue[i].front();
}
@ -178,7 +178,7 @@ bool GlobalScheduler::YieldThreadAndWaitForLoadBalancing(Thread* yielding_thread
if (scheduled_queue[core_id].empty()) {
// Here, "current_threads" is calculated after the ""yield"", unlike yield -1
std::array<Thread*, Core::Hardware::NUM_CPU_CORES> current_threads;
for (u32 i = 0; i < Core::Hardware::NUM_CPU_CORES; i++) {
for (std::size_t i = 0; i < current_threads.size(); i++) {
current_threads[i] = scheduled_queue[i].empty() ? nullptr : scheduled_queue[i].front();
}
for (auto& thread : suggested_queue[core_id]) {