瀏覽代碼

fix(idle_task): disable irq when we use scheduler

greatbridf 3 周之前
父節點
當前提交
44231d9217
共有 1 個文件被更改,包括 1 次插入2 次删除
  1. 1 2
      src/kernel/task/scheduler.rs

+ 1 - 2
src/kernel/task/scheduler.rs

@@ -185,8 +185,7 @@ extern "C" fn idle_task() {
     loop {
         debug_assert_eq!(preempt::count(), 1);
 
-        // SAFETY: No need to call `lock_irq`, preempt is already disabled.
-        let mut scheduler = Scheduler::get().lock();
+        let mut scheduler = Scheduler::get().lock_irq();
         let state = *Thread::current().state.lock();
 
         // Previous thread is `Running`.