From 525a102f20438e8ae4878da1eae7fdbc518180b0 Mon Sep 17 00:00:00 2001 From: EnderIce2 Date: Sat, 2 Mar 2024 00:16:18 +0200 Subject: [PATCH] Implement GetIdle function in Custom scheduler --- include/scheduler.hpp | 6 ++++++ tasking/scheduler/custom.cpp | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/include/scheduler.hpp b/include/scheduler.hpp index b23aa0b..9025589 100644 --- a/include/scheduler.hpp +++ b/include/scheduler.hpp @@ -93,6 +93,11 @@ namespace Tasking::Scheduler assert(!"PopProcess not implemented"); } + virtual std::pair GetIdle() + { + assert(!"GetIdle not implemented"); + } + Base(Task *_ctx) : ctx(_ctx) {} @@ -121,6 +126,7 @@ namespace Tasking::Scheduler void Yield() final; void PushProcess(PCB *pcb) final; void PopProcess(PCB *pcb) final; + std::pair GetIdle() final; void OneShot(int TimeSlice); diff --git a/tasking/scheduler/custom.cpp b/tasking/scheduler/custom.cpp index f224fd2..286d570 100644 --- a/tasking/scheduler/custom.cpp +++ b/tasking/scheduler/custom.cpp @@ -252,6 +252,11 @@ namespace Tasking::Scheduler this->ProcessList.remove(pcb); } + std::pair Custom::GetIdle() + { + return std::make_pair(IdleProcess, IdleThread); + } + /* --------------------------------------------------------------- */ nsa void Custom::OneShot(int TimeSlice)