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
sourceimpl 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 !RefUnwindSafe for TaskManager
impl Send for TaskManager
impl Sync for TaskManager
impl Unpin for TaskManager
impl !UnwindSafe for TaskManager
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more