Skip to content

Commit

Permalink
[fix] delete if self.on_cpu() block in unblock_locked
Browse files Browse the repository at this point in the history
  • Loading branch information
hky1999 committed Sep 30, 2024
1 parent 71909cf commit 75b7756
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions modules/axtask/src/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,13 +337,11 @@ impl TaskInner {
//
// This ensures that tasks getting woken will be fully ordered against
// their previous state and preserve Program Order.
if self.on_cpu() {
while self.on_cpu() {
// Wait for the task to finish its scheduling process.
core::hint::spin_loop();
}
assert!(!self.on_cpu())
while self.on_cpu() {
// Wait for the task to finish its scheduling process.
core::hint::spin_loop();
}
assert!(!self.on_cpu());

// When irq is enabled, use `unblock_lock` to protect the task from being unblocked by timer and `notify()` at the same time.
#[cfg(feature = "irq")]
Expand Down

0 comments on commit 75b7756

Please sign in to comment.