Struct os::task::manager::TaskManager
source · pub struct TaskManager {
ready_queue: VecDeque<Arc<TaskControlBlock>>,
stop_task: Option<Arc<TaskControlBlock>>,
}Expand description
A array of TaskControlBlock that is thread-safe
Fields§
§ready_queue: VecDeque<Arc<TaskControlBlock>>§stop_task: Option<Arc<TaskControlBlock>>The stopping task, leave a reference so that the kernel stack will not be recycled when switching tasks
Implementations§
source§impl TaskManager
impl TaskManager
A simple FIFO scheduler.
sourcepub fn add(&mut self, task: Arc<TaskControlBlock>)
pub fn add(&mut self, task: Arc<TaskControlBlock>)
Add process back to ready queue
sourcepub fn fetch(&mut self) -> Option<Arc<TaskControlBlock>>
pub fn fetch(&mut self) -> Option<Arc<TaskControlBlock>>
Take a process out of the ready queue
pub fn remove(&mut self, task: Arc<TaskControlBlock>)
sourcepub fn add_stop(&mut self, task: Arc<TaskControlBlock>)
pub fn add_stop(&mut self, task: Arc<TaskControlBlock>)
Add a task to stopping task
Auto Trait Implementations§
impl Freeze for TaskManager
impl !RefUnwindSafe for TaskManager
impl Send for TaskManager
impl Sync for TaskManager
impl Unpin for TaskManager
impl !UnwindSafe for TaskManager
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more