Struct os::task::TaskManager
source · [−]#[repr(C)]pub struct TaskManager {
pub upper_border: usize,
pub ready_queue: VecDeque<Arc<TaskControlBlock>>,
pub lower_border: usize,
}
Expand description
A array of TaskControlBlock
that is thread-safe
Fields
upper_border: usize
upper_border
ready_queue: VecDeque<Arc<TaskControlBlock>>
ready_queue
lower_border: usize
lower_border
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 a task to TaskManager
sourcepub fn fetch(&mut self) -> Option<Arc<TaskControlBlock>>
pub fn fetch(&mut self) -> Option<Arc<TaskControlBlock>>
Remove the first task and return it,or None
if TaskManager
is empty
sourcepub fn get_ready_queue_pointer(&mut self) -> &VecDeque<Arc<TaskControlBlock>>
pub fn get_ready_queue_pointer(&mut self) -> &VecDeque<Arc<TaskControlBlock>>
Get ready_queue_pointer
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