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
@ -320,6 +320,12 @@ kthread_add(void (*func)(void *), void *arg, struct proc *p,
|
|||||||
void
|
void
|
||||||
kthread_exit(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();
|
thread_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user