diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-08-26 18:51:10 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-08-26 18:51:10 +0300 |
| commit | b25156373cd89792b1c457b77699bb7f9beb430d (patch) | |
| tree | 56816903fcedc9fe35786b9baf43499d4ec3d19f /src/orphanage.c | |
| parent | 260fc4c790ca25ee1ffab4edd9c6488d3bcb441c (diff) | |
| download | kmi-b25156373cd89792b1c457b77699bb7f9beb430d.tar.gz kmi-b25156373cd89792b1c457b77699bb7f9beb430d.zip | |
improve killing processes/threads, test
+ Remove sys_kill() as we should be using a two-stage process where a
thread is first orphaned by sys_detach(), and then the thread itself
calls sys_exit() after it has done all necessary cleanup in init.
Diffstat (limited to 'src/orphanage.c')
| -rw-r--r-- | src/orphanage.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/orphanage.c b/src/orphanage.c index 526affc..797468d 100644 --- a/src/orphanage.c +++ b/src/orphanage.c @@ -29,16 +29,16 @@ void unorphanize(struct tcb *t) /* attach to init process */ struct tcb *init = get_tcb(1); - reference_proc(init); + reference_thread(init); + + free_stack(t); + reset_rpc_stack(t); id_t old_rid = t->rid; t->rid = 1; t->pid = 1; t->eid = 1; - free_stack(t); - reset_rpc_stack(t); - t->proc = init->proc; use_vmem(t->proc.vmem); alloc_stack(t); |
