Browse Source

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 4 months ago
parent
commit
0192745ef2
1 changed files with 1 additions and 1 deletions
  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);