Struct os::task::TaskManager
source · [−]pub struct TaskManager {
num_app: usize,
inner: UPSafeCell<TaskManagerInner>,
}
Fields
num_app: usize
total number of tasks
inner: UPSafeCell<TaskManagerInner>
use inner value to get mutable access
Implementations
Run the first task in task list.
Generally, the first task in task list is an idle task (we call it zero process later). But in ch3, we load apps statically, so the first task is a real app.
Change the status of current Running
task into Ready
.
Change the status of current Running
task into Exited
.
Find next task to run and return app id.
In this case, we only return the first Ready
task in task list.
Switch current Running
task to the task we have found,
or there is no Ready
task and we can exit with all applications completed