ITaskSwitchPolicy interface
Decides when a SchedulerKind::TaskSwap scheduler switches tasks.
- Use
#include <ThinkMeta.ConcurrentTasks/Core.h>- Namespace
ThinkMeta::ConcurrentTasks
Syntax
struct ITaskSwitchPolicySee also
SchedulerInfo::taskSwitchPolicy
Methods
ShouldSwitch
Returns whether the scheduler should switch away from the running task now.
Syntax
virtual bool ShouldSwitch(ITask* currentTask) noexcept = 0;Parameters
currentTaskITask*- The task the scheduler is running at the moment; borrowed.
Return value
Type: bool
true to switch to the other task; false to keep the current one.
Remarks
Called on the scheduler's thread; must be short and must not suspend.
Generated from ThinkMeta.ConcurrentTasks.API @ 137ec1d (2026-10-17).