Explorar o código

fix(scheduler): permit iwake called on Running threads

We might be doing something in some random context when we receive a
signal or some irq handler is trying to wake us up. We are in Running
state and that could be a problem if we don't allow doing that.
greatbridf hai 4 meses
pai
achega
0192745ef2
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/kernel/task/scheduler.rs

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

@@ -108,7 +108,7 @@ impl Scheduler {
         let mut state = thread.state.lock();
 
         match *state {
-            ThreadState::USleep => return,
+            ThreadState::Running | ThreadState::USleep => return,
             ThreadState::ISleep => {
                 *state = ThreadState::Ready;
                 self.enqueue(&thread);