If kthread_exit() is called on the last kthread in a kproc, then
all the work in kproc_exit must be done. We don't actually have a user of this yet but why leave it to chance.
This commit is contained in:
parent
ca9a0ddf31
commit
6bc3d1dc09
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=173046
@ -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();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user