From fa6dee36dab370d3f6786ee8fd9b5bf45ff46790 Mon Sep 17 00:00:00 2001 From: 4lDO2 <4lDO2@protonmail.com> Date: Thu, 10 Apr 2025 14:38:09 +0200 Subject: [PATCH] Report all being_sigkilled contexts as Dead. --- src/scheme/proc.rs | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/scheme/proc.rs b/src/scheme/proc.rs index e56753c285..342f3a726a 100644 --- a/src/scheme/proc.rs +++ b/src/scheme/proc.rs @@ -1265,17 +1265,21 @@ impl ContextHandle { Ok(mem::size_of_val(&mask)) } // TODO: Replace write() with SYS_SENDFD? ContextHandle::Status { .. } => { - let status = match context.read().status { - Status::Runnable => ContextStatus::Runnable, - Status::Blocked => ContextStatus::Blocked, - Status::Dead => ContextStatus::Dead, - Status::HardBlocked { - reason: HardBlockedReason::NotYetStarted, - } => ContextStatus::NotYetStarted, - Status::HardBlocked { - reason: HardBlockedReason::Stopped, - } => ContextStatus::Stopped, - _ => ContextStatus::Other, + let status = { + let context = context.read(); + match context.status { + Status::Dead => ContextStatus::Dead, + Status::Runnable if context.being_sigkilled => ContextStatus::Dead, + Status::Runnable => ContextStatus::Runnable, + Status::Blocked => ContextStatus::Blocked, + Status::HardBlocked { + reason: HardBlockedReason::NotYetStarted, + } => ContextStatus::NotYetStarted, + Status::HardBlocked { + reason: HardBlockedReason::Stopped, + } => ContextStatus::Stopped, + _ => ContextStatus::Other, + } }; buf.copy_common_bytes_from_slice(&(status as usize).to_ne_bytes()) }