pub struct Scheduler {
pub current: Option<TaskPtr>,
pub idle_task: Option<TaskPtr>,
pub algorithm: SchedAlgorithm,
pub preemption_enabled: AtomicBool,
pub lock_count: AtomicU64,
pub cpu_id: u8,
pub cfs_queue: Option<Mutex<CfsRunQueue>>,
}Expand description
Scheduler state
Fields§
§current: Option<TaskPtr>Currently running task
idle_task: Option<TaskPtr>Idle task
algorithm: SchedAlgorithmScheduling algorithm
preemption_enabled: AtomicBoolPreemption enabled
lock_count: AtomicU64Scheduler lock count
cpu_id: u8CPU ID this scheduler is running on
cfs_queue: Option<Mutex<CfsRunQueue>>CFS run queue (if using CFS)
Implementations§
Source§impl Scheduler
impl Scheduler
Sourcepub fn disable_preemption(&self)
pub fn disable_preemption(&self)
Disable preemption
Sourcepub fn enable_preemption(&self)
pub fn enable_preemption(&self)
Enable preemption
Sourcepub fn is_preemptible(&self) -> bool
pub fn is_preemptible(&self) -> bool
Check if preemption is enabled
Sourcepub fn update_runtime(&self, task: NonNull<Task>, runtime: u64)
pub fn update_runtime(&self, task: NonNull<Task>, runtime: u64)
Update task runtime statistics