kernel: services: don't resume sleeping processes after irq

After an IRQ occurs, check to see if there are any available threads.
If there are none, put the process back to sleep.

Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
Sean Cross 2020-03-27 17:05:37 +08:00
parent 263e57d4aa
commit 9367905e6f

View file

@ -325,6 +325,7 @@ impl SystemServices {
.get_process_mut(current_pid)
.expect("couldn't get current PID");
current.state = match current.state {
ProcessState::Running(0) => ProcessState::Sleeping,
ProcessState::Running(x) => ProcessState::Ready(x),
y => panic!("current process was {:?}, not 'Running(_)'", y),
};