aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/kern/kern_thr.c10
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);