pub struct SchedulerState<K: Kernel> {
pub(crate) kernel_process: UnsafeCell<Process<K>>,
pub(super) current_thread: Option<ForeignBox<Thread<K>>>,
pub(super) current_arch_thread_state: *mut K::ThreadState,
pub(super) process_list: ForeignList<Process<K>, ProcessListAdapter<K>>,
pub(super) algorithm: GlobalQueueScheduler<K>,
pub(super) termination_queue: ForeignList<Thread<K>, ThreadListAdapter<K>>,
}Fields§
§kernel_process: UnsafeCell<Process<K>>§current_thread: Option<ForeignBox<Thread<K>>>§current_arch_thread_state: *mut K::ThreadState§process_list: ForeignList<Process<K>, ProcessListAdapter<K>>§algorithm: GlobalQueueScheduler<K>The algorithm used for choosing the next thread to run.
termination_queue: ForeignList<Thread<K>, ThreadListAdapter<K>>Implementations§
Source§impl<K: Kernel> SchedulerState<K>
impl<K: Kernel> SchedulerState<K>
pub const fn new() -> Self
fn reschedule_current_thread( &mut self, reason: RescheduleReason, ) -> (usize, State)
fn set_current_thread(&mut self, thread: ForeignBox<Thread<K>>)
pub fn current_thread_id(&self) -> usize
pub fn current_thread_name(&self) -> &'static str
pub fn take_current_thread(&mut self) -> ForeignBox<Thread<K>>
pub fn current_thread(&self) -> &Thread<K>
pub fn current_thread_mut(&mut self) -> &mut Thread<K>
pub fn current_process_handle(&self) -> ProcessHandle<K>
Sourcepub fn add_process_to_list(&mut self, process: ForeignBox<Process<K>>)
pub fn add_process_to_list(&mut self, process: ForeignBox<Process<K>>)
§Safety
This method has the same safety preconditions as
UnsafeList::push_front_unchecked.