From 9c90e73fda0d5df2e1f11b32d459d3bb07a63192 Mon Sep 17 00:00:00 2001 From: sotech117 Date: Tue, 20 Feb 2024 19:49:59 +0000 Subject: small conceptual issue with retvals when threads are cancelled. will ask --- kernel/proc/proc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'kernel/proc/proc.c') diff --git a/kernel/proc/proc.c b/kernel/proc/proc.c index 7350acb..a1f68f8 100644 --- a/kernel/proc/proc.c +++ b/kernel/proc/proc.c @@ -268,7 +268,11 @@ void proc_cleanup(long status) // update state and status curproc->p_state = PROC_DEAD; - curproc->p_status = status; + if (curthr->kt_cancelled) { + curproc->p_status = curthr->kt_retval; + } else { + curproc->p_status = status; + } } /* -- cgit v1.2.3-70-g09d2