Clean up confusing comment. Move it to the place of code which is
talked about. Explain where the mentioned trampoline located (usermode), and the fact that attempt to exit last thread is denied in kernel (by delegating the work to usermode). Sponsored by: The FreeBSD Foundation MFC after: 1 week
This commit is contained in:
parent
d2d52b0013
commit
74d5b4af82
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=274038
@ -317,10 +317,6 @@ sys_thr_exit(struct thread *td, struct thr_exit_args *uap)
|
|||||||
|
|
||||||
PROC_LOCK(p);
|
PROC_LOCK(p);
|
||||||
|
|
||||||
/*
|
|
||||||
* Shutting down last thread in the proc. This will actually
|
|
||||||
* call exit() in the trampoline when it returns.
|
|
||||||
*/
|
|
||||||
if (p->p_numthreads != 1) {
|
if (p->p_numthreads != 1) {
|
||||||
racct_sub(p, RACCT_NTHR, 1);
|
racct_sub(p, RACCT_NTHR, 1);
|
||||||
LIST_REMOVE(td, td_hash);
|
LIST_REMOVE(td, td_hash);
|
||||||
@ -331,6 +327,12 @@ sys_thr_exit(struct thread *td, struct thr_exit_args *uap)
|
|||||||
thread_exit();
|
thread_exit();
|
||||||
/* NOTREACHED */
|
/* NOTREACHED */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Ignore attempts to shut down last thread in the proc. This
|
||||||
|
* will actually call _exit(2) in the usermode trampoline when
|
||||||
|
* it returns.
|
||||||
|
*/
|
||||||
PROC_UNLOCK(p);
|
PROC_UNLOCK(p);
|
||||||
rw_wunlock(&tidhash_lock);
|
rw_wunlock(&tidhash_lock);
|
||||||
return (0);
|
return (0);
|
||||||
|
Loading…
Reference in New Issue
Block a user