diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2014-11-03 11:29:08 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2014-11-03 11:29:08 +0000 |
commit | 74d5b4af82a9a9acdb3a5c255b9e8b59549fe4b7 (patch) | |
tree | 543b7c2a419bb15e5967dce2005e046a6a5d1bc9 /sys/kern/kern_thr.c | |
parent | d2d52b00136d3c7f31d6ef19b43f4b0479c5ebe3 (diff) | |
download | src-74d5b4af82a9a9acdb3a5c255b9e8b59549fe4b7.tar.gz src-74d5b4af82a9a9acdb3a5c255b9e8b59549fe4b7.zip |
Notes
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 4270b41fd0c4..b298f3387862 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); |