From 868b27c33a790ee2b9d2fbd470f3a20832c93d4e Mon Sep 17 00:00:00 2001 From: jhb Date: Sat, 23 Jan 2016 01:21:11 +0000 Subject: [PATCH] MFC 292892: Call kern_thr_exit() instead of duplicating it. This code is missing the racct_subr() call from kern_thr_exit() and would require further code duplication in future changes. git-svn-id: svn://svn.freebsd.org/base/stable/10@294614 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/kern/kern_thread.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index 96f68609c..c85813b8a 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -885,7 +886,6 @@ thread_suspend_check(int return_instead) */ if ((p->p_flag & P_SINGLE_EXIT) && (p->p_singlethread != td)) { PROC_UNLOCK(p); - tidhash_remove(td); /* * Allow Linux emulation layer to do some work @@ -893,13 +893,8 @@ thread_suspend_check(int return_instead) */ if (__predict_false(p->p_sysent->sv_thread_detach != NULL)) (p->p_sysent->sv_thread_detach)(td); - - PROC_LOCK(p); - tdsigcleanup(td); - umtx_thread_exit(td); - PROC_SLOCK(p); - thread_stopped(p); - thread_exit(); + kern_thr_exit(td); + panic("stopped thread did not exit"); } PROC_SLOCK(p); -- 2.45.0