aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/kern_kthread.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/kern_kthread.c')
-rw-r--r--sys/kern/kern_kthread.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/sys/kern/kern_kthread.c b/sys/kern/kern_kthread.c
index 092d0b9a0e0f..5cc4bd275bcd 100644
--- a/sys/kern/kern_kthread.c
+++ b/sys/kern/kern_kthread.c
@@ -350,15 +350,12 @@ kthread_exit(void)
* The last exiting thread in a kernel process must tear down
* the whole process.
*/
- rw_wlock(&tidhash_lock);
PROC_LOCK(p);
if (p->p_numthreads == 1) {
PROC_UNLOCK(p);
- rw_wunlock(&tidhash_lock);
kproc_exit(0);
}
- LIST_REMOVE(td, td_hash);
- rw_wunlock(&tidhash_lock);
+ tidhash_remove(td);
umtx_thread_exit(td);
tdsigcleanup(td);
PROC_SLOCK(p);