Skip to content

Commit

Permalink
Don't remove idle task
Browse files Browse the repository at this point in the history
  • Loading branch information
mrgian committed Jun 30, 2023
1 parent 91e7e88 commit b7fa004
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions kernel/src/multitasking/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,10 @@ impl TaskManager {

//remove task
pub fn remove_task(&mut self, id: usize) {
self.tasks[id] = 0 as *mut Task;
self.task_count -= 1;
if id != 0 {
self.tasks[id] = 0 as *mut Task;
self.task_count -= 1;
}
}

pub fn remove_current_task(&mut self) {
Expand Down

0 comments on commit b7fa004

Please sign in to comment.