diff options
author | kib <kib@FreeBSD.org> | 2014-11-03 11:29:08 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2014-11-03 11:29:08 +0000 |
commit | 649fe8c57c0e5bb67b954054705a6dce803166a7 (patch) | |
tree | 543b7c2a419bb15e5967dce2005e046a6a5d1bc9 /sys/kern/kern_thr.c | |
parent | 6818c3b471ac76539c440ef258c5653b0371ff6f (diff) | |
download | FreeBSD-src-649fe8c57c0e5bb67b954054705a6dce803166a7.zip FreeBSD-src-649fe8c57c0e5bb67b954054705a6dce803166a7.tar.gz |
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
Diffstat (limited to 'sys/kern/kern_thr.c')
-rw-r--r-- | sys/kern/kern_thr.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/kern/kern_thr.c b/sys/kern/kern_thr.c index 4270b41..b298f33 100644 --- a/sys/kern/kern_thr.c +++ b/sys/kern/kern_thr.c @@ -317,10 +317,6 @@ sys_thr_exit(struct thread *td, struct thr_exit_args *uap) 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) { racct_sub(p, RACCT_NTHR, 1); LIST_REMOVE(td, td_hash); @@ -331,6 +327,12 @@ sys_thr_exit(struct thread *td, struct thr_exit_args *uap) thread_exit(); /* 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); rw_wunlock(&tidhash_lock); return (0); |