Skip to content

Commit

Permalink
[fix] use NoPreemptIrqSave in current_check_preempt_pending
Browse files Browse the repository at this point in the history
  • Loading branch information
hky1999 committed Oct 13, 2024
1 parent b939a43 commit 1560027
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/axtask/src/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use alloc::sync::Weak;
#[cfg(feature = "preempt")]
use core::sync::atomic::AtomicUsize;

use kernel_guard::IrqSave;
use kspin::SpinNoIrq;
use memory_addr::{align_up_4k, VirtAddr};

Expand Down Expand Up @@ -383,9 +382,10 @@ impl TaskInner {

#[cfg(feature = "preempt")]
fn current_check_preempt_pending() {
use kernel_guard::NoPreemptIrqSave;
let curr = crate::current();
if curr.need_resched.load(Ordering::Acquire) && curr.can_preempt(0) {
let mut rq = crate::current_run_queue::<IrqSave>();
let mut rq = crate::current_run_queue::<NoPreemptIrqSave>();
if curr.need_resched.load(Ordering::Acquire) {
rq.preempt_resched()
}
Expand Down

0 comments on commit 1560027

Please sign in to comment.