10#ifndef STK_STRATEGY_RROBIN_H_
11#define STK_STRATEGY_RROBIN_H_
203 bool handled =
false;
Contains interface definitions of the library.
#define STK_UNUSED(X)
Explicitly marks a variable as unused to suppress compiler warnings.
#define STK_ASSERT(e)
Runtime assertion. Halts execution if the expression e evaluates to false.
#define __stk_constexpr_cpp17
constexpr definition for C++17 and above.
#define STK_VIRT_DTOR
Makes destructors virtual and compliant to strict rules if STK_STRICT_COMPLIANCY=0.
Namespace of STK package.
SwitchStrategyRoundRobinT< true > SwitchStrategyRR_NSY
Shorthand for SwitchStrategyRoundRobinNoSleepYield.
SwitchStrategyRoundRobinT< false > SwitchStrategyRoundRobin
Shorthand alias for SwitchStrategyRoundRobinT<>.
SwitchStrategyRoundRobinT< true > SwitchStrategyRoundRobinNoSleepYield
Round-Robin strategy where Yield() keeps the task runnable (NOSLEEP_YIELD_API = 1).
SwitchStrategyRoundRobinT< false > SwitchStrategyRR
Shorthand alias for SwitchStrategyRoundRobin.
Scheduling-strategy-facing interface for a kernel task slot.
DLHeadType ListHeadType
List head type for IKernelTask elements.
virtual bool IsSleeping() const =0
Check whether the task is currently sleeping.
Interface for a task switching strategy implementation.
DLEntryType * GetNext()
Get the next entry in the list.
DLHeadType * GetHead()
Get the list head this entry currently belongs to.
DLEntryType * GetPrev()
Get the previous entry in the list.
void AddTask(IKernelTask *task) override
Add task to the runnable set.
void OnTaskWake(IKernelTask *task) override
Notification that a task has become runnable again.
IKernelTask::ListHeadType m_tasks
SwitchStrategyRoundRobinT()
Construct an empty strategy with no tasks and a null cursor.
STK_NONCOPYABLE_CLASS(SwitchStrategyRoundRobinT)
IKernelTask * GetNext() override
Advance cursor and return the next runnable task.
void RemoveTask(IKernelTask *task) override
Remove task from whichever list it currently occupies.
void AddActive(IKernelTask *task)
Append a task to m_tasks and restore the cursor if necessary.
void OnTaskSleep(IKernelTask *task) override
Notification that a task has entered the sleeping state.
IKernelTask * GetFirst() override
Get first task in the managed set (used by the kernel for initial scheduling).
STK_VIRT_DTOR ~SwitchStrategyRoundRobinT()=default
Destructor.
void RemoveActive(IKernelTask *task)
Remove a task from m_tasks and update the cursor.
size_t GetSize() const override
Get total number of tasks managed by this strategy.
IKernelTask::ListHeadType m_sleep
bool OnTaskYield(IKernelTask *task) override
Notification that the running task called Yield() (non-HRT kernel modes only).
EConfig
Compile-time capability flags reported to the kernel.
@ PRIORITY_INHERITANCE_API