From 16138fc20fc9c472af37fb8385a997a0d9202f32 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Sun, 24 Sep 2023 14:06:34 +0200 Subject: kernel: delay removing processes from tree --- src/kernel/proc.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/kernel/proc.h') diff --git a/src/kernel/proc.h b/src/kernel/proc.h index 5d95b52..d437b8c 100644 --- a/src/kernel/proc.h +++ b/src/kernel/proc.h @@ -12,9 +12,7 @@ enum proc_state { PS_DYING, /* during proc_kill - mostly treated as alive */ PS_TOREAP, /* return message not collected */ PS_TOMBSTONE, /* fully dead, supports alive children */ - /* not in the process tree, waits for free. - * *sibling holds a linked list of all the FORGOTTEN processes */ - PS_FORGOTTEN, + PS_DEADLEAF, PS_FREED, /* only meant to detect double frees */ PS_WAITS4CHILDDEATH, @@ -29,7 +27,7 @@ enum proc_state { #define proc_alive(p) (p \ && p->state != PS_TOREAP \ && p->state != PS_TOMBSTONE \ - && p->state != PS_FORGOTTEN \ + && p->state != PS_DEADLEAF \ && p->state != PS_FREED \ ) @@ -64,6 +62,7 @@ struct Proc { uint64_t goal; Proc *next; } waits4timer; + Proc *deadleaf_next; }; VfsMount *mount; @@ -117,8 +116,6 @@ Proc *proc_ns_next(Proc *ns, Proc *p); void proc_ns_create(Proc *proc); void proc_kill(Proc *proc, int ret); -/** Kills all descendants. */ -void proc_filicide(Proc *proc, int ret); /** Tries to reap a dead process / free a tombstone. */ void proc_tryreap(Proc *dead); -- cgit v1.2.3