From 7e828ec1e1479ff9a8afe845539d08ca0dfada5f Mon Sep 17 00:00:00 2001 From: Kimplul Date: Mon, 8 Jul 2024 17:38:59 +0300 Subject: add orphan checking to timer and irq handling --- include/kmi/orphanage.h | 7 +++++++ include/kmi/syscalls.h | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/kmi/orphanage.h b/include/kmi/orphanage.h index 98756c2..0506af3 100644 --- a/include/kmi/orphanage.h +++ b/include/kmi/orphanage.h @@ -26,6 +26,13 @@ bool orphan(struct tcb *t); /** * Mark \p t orphaned. + * Once a thread has been orphaned, it can't 'truly' be adopted by anyone again, + * and the init process will generally just make sure all the thread's resources + * are freed in a controlled manner. + * + * I did think about maybe allowing threads to be reused, I guess to save a bit + * of build/teardown time but I don't think it's worth it for the extra + * complexity. * * @param t Thread to orphanize. */ diff --git a/include/kmi/syscalls.h b/include/kmi/syscalls.h index eece89e..b6cde34 100644 --- a/include/kmi/syscalls.h +++ b/include/kmi/syscalls.h @@ -177,9 +177,9 @@ enum sys_user { /** Thread has been orphaned. */ SYS_USER_ORPHANED, - /** Core has booted an init thread. Only used during booting, should be - * handled specially. */ - SYS_USER_BOOTED, + /** A new process has been spawned. Special case for init where each + * core starts with this, usually it is reserved for exec. */ + SYS_USER_SPAWNED, }; /** Which notifications have arrived. */ -- cgit v1.3