summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authordchagin <dchagin@FreeBSD.org>2016-01-09 14:36:44 +0000
committerdchagin <dchagin@FreeBSD.org>2016-01-09 14:36:44 +0000
commitb18ea4d2a0bcd9dbc2f21c20535204945cedf82d (patch)
tree98fa8640a63947fa2fcf8fa5a612218e56aeaa30 /sys/kern
parent994d3d588922f9f69ec5ae11759551398228bf1a (diff)
downloadFreeBSD-src-b18ea4d2a0bcd9dbc2f21c20535204945cedf82d.zip
FreeBSD-src-b18ea4d2a0bcd9dbc2f21c20535204945cedf82d.tar.gz
MFC r283372:
In preparation for switching linuxulator to the use the native 1:1 threads split sys_thr_exit() up into sys_thr_exit() and kern_thr_exit(). Move Where the second will be used in linux_exit() system call later.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_thr.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/sys/kern/kern_thr.c b/sys/kern/kern_thr.c
index 058dc19..e2cb5dd 100644
--- a/sys/kern/kern_thr.c
+++ b/sys/kern/kern_thr.c
@@ -305,9 +305,6 @@ int
sys_thr_exit(struct thread *td, struct thr_exit_args *uap)
/* long *state */
{
- struct proc *p;
-
- p = td->td_proc;
/* Signal userland that it can free the stack. */
if ((void *)uap->state != NULL) {
@@ -315,8 +312,17 @@ sys_thr_exit(struct thread *td, struct thr_exit_args *uap)
kern_umtx_wake(td, uap->state, INT_MAX, 0);
}
- rw_wlock(&tidhash_lock);
+ return (kern_thr_exit(td));
+}
+
+int
+kern_thr_exit(struct thread *td)
+{
+ struct proc *p;
+ p = td->td_proc;
+
+ rw_wlock(&tidhash_lock);
PROC_LOCK(p);
if (p->p_numthreads != 1) {
OpenPOWER on IntegriCloud