From 38dd7bb947eb94ee77bf2ea3ccf16a326b991359 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Fri, 6 May 2022 13:36:50 +0200 Subject: kernel/proc: move shutdown() to process_kill --- src/kernel/proc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/kernel/proc.c b/src/kernel/proc.c index 54efe85..3233725 100644 --- a/src/kernel/proc.c +++ b/src/kernel/proc.c @@ -113,9 +113,6 @@ _Noreturn void process_switch_any(void) { struct process *found = process_find(PS_RUNNING); if (found) process_switch(found); - if (process_first->state == PS_DEAD) - shutdown(); // TODO not the place for this - cpu_pause(); process_switch_any(); } @@ -253,6 +250,8 @@ void process_kill(struct process *p, int ret) { assert(!p->child); process_try2collect(p); + + if (p == process_first) shutdown(); } int process_try2collect(struct process *dead) { -- cgit v1.2.3