summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordzwdz2022-05-06 13:36:50 +0200
committerdzwdz2022-05-06 13:36:50 +0200
commit38dd7bb947eb94ee77bf2ea3ccf16a326b991359 (patch)
tree493ed4df74ba9f6ef38d9174875235fab0ef08a4 /src
parent530d2292182ae4e35e4a13929831a6803f517128 (diff)
kernel/proc: move shutdown() to process_kill
Diffstat (limited to 'src')
-rw-r--r--src/kernel/proc.c5
1 files changed, 2 insertions, 3 deletions
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) {