diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_kthread.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/kern/kern_kthread.c b/sys/kern/kern_kthread.c index cb231c8..03d404b 100644 --- a/sys/kern/kern_kthread.c +++ b/sys/kern/kern_kthread.c @@ -320,6 +320,12 @@ kthread_add(void (*func)(void *), void *arg, struct proc *p, void kthread_exit(void) { + /* + * We could rely on thread_exit to call exit1() but + * there is extra work that needs to be done + */ + if (curthread->td_proc->p_numthreads == 1) + kproc_exit(0); thread_exit(); } |