Parcourir la source

fix(idle_task): disable irq when we use scheduler

greatbridf il y a 3 semaines
Parent
commit
44231d9217
1 fichiers modifiés avec 1 ajouts et 2 suppressions
  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`.