Jelajahi Sumber

fix(idle_task): disable irq when we use scheduler

greatbridf 3 minggu lalu
induk
melakukan
44231d9217
1 mengubah file dengan 1 tambahan dan 2 penghapusan
  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`.