Skip to content

Commit

Permalink
[fix] use put_prev_task in unblock_task
Browse files Browse the repository at this point in the history
  • Loading branch information
hky1999 committed Sep 30, 2024
1 parent 2782e4e commit 1f7ac39
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 4 additions & 1 deletion modules/axtask/src/run_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,10 @@ impl<'a, G: BaseGuard> AxRunQueueRef<'a, G> {
let cpu_id = self.inner.cpu_id;
debug!("task unblock: {} on run_queue {}", task.id_name(), cpu_id);
task.set_state(TaskState::Ready);
self.inner.scheduler.lock().add_task(task.clone()); // TODO: priority
self.inner
.scheduler
.lock()
.put_prev_task(task.clone(), resched); // TODO: priority

// Note: when the task is unblocked on another CPU's run queue,
// we just ingiore the `resched` flag.
Expand Down
2 changes: 0 additions & 2 deletions modules/axtask/src/timers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ impl TimerEvent for TaskWakeupEvent {
}

// Timer ticket match.
// Timer event is triggered, expire the ticket ID.
self.task.timer_ticket_expired();
select_run_queue::<NoOp>(self.task.clone()).unblock_task(self.task, true)
}
}
Expand Down

0 comments on commit 1f7ac39

Please sign in to comment.