diff --git a/src/context/context.rs b/src/context/context.rs index c97c5166be..29ddc3af2f 100644 --- a/src/context/context.rs +++ b/src/context/context.rs @@ -60,6 +60,9 @@ impl Status { pub fn is_soft_blocked(&self) -> bool { matches!(self, Self::Blocked) } + pub fn is_dead(&self) -> bool { + matches!(self, Self::Dead { .. }) + } } #[derive(Clone, Debug)] diff --git a/src/context/switch.rs b/src/context/switch.rs index 86684c8f4c..f92b62d874 100644 --- a/src/context/switch.rs +++ b/src/context/switch.rs @@ -336,6 +336,9 @@ fn wakeup_contexts(token: &mut CleanLockToken, switch_time: u128) -> Vec<(usize, continue; } } + } else if guard.status.is_dead() { + // TODO: who hold this dead context? + continue; } if guard.status.is_runnable() && !guard.running {