diff options
author | dchagin <dchagin@FreeBSD.org> | 2015-05-24 14:36:33 +0000 |
---|---|---|
committer | dchagin <dchagin@FreeBSD.org> | 2015-05-24 14:36:33 +0000 |
commit | aa808515271af610d5e6fc4c1a12b83763077564 (patch) | |
tree | f6a30323f026cfe89722b979627ba30963645d56 /sys/kern/kern_thr.c | |
parent | 497e0962582b86e2ff2e729a5d49cd7c2a1d79e8 (diff) | |
download | FreeBSD-src-aa808515271af610d5e6fc4c1a12b83763077564.zip FreeBSD-src-aa808515271af610d5e6fc4c1a12b83763077564.tar.gz |
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.
Differential Revision: https://reviews.freebsd.org/D1028
Reviewed by: trasz
Diffstat (limited to 'sys/kern/kern_thr.c')
-rw-r--r-- | sys/kern/kern_thr.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/sys/kern/kern_thr.c b/sys/kern/kern_thr.c index 6911bb97..e686b22 100644 --- a/sys/kern/kern_thr.c +++ b/sys/kern/kern_thr.c @@ -307,9 +307,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) { @@ -317,8 +314,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) { |