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
This commit is contained in:
Dmitry Chagin 2015-05-24 14:36:33 +00:00
parent 8c744294fe
commit 95be6d2b1f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=283372
2 changed files with 11 additions and 4 deletions

View File

@ -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) {

View File

@ -214,6 +214,7 @@ int kern_ktimer_settime(struct thread *td, int timer_id, int flags,
int kern_ktimer_gettime(struct thread *td, int timer_id,
struct itimerspec *val);
int kern_ktimer_getoverrun(struct thread *td, int timer_id);
int kern_thr_exit(struct thread *td);
int kern_thr_new(struct thread *td, struct thr_param *param);
int kern_thr_suspend(struct thread *td, struct timespec *tsp);
int kern_truncate(struct thread *td, char *path, enum uio_seg pathseg,