diff options
-rw-r--r-- | lib/libthr/thread/thr_exit.c | 5 | ||||
-rw-r--r-- | sys/compat/freebsd32/freebsd32_proto.h | 2 | ||||
-rw-r--r-- | sys/compat/freebsd32/freebsd32_syscall.h | 2 | ||||
-rw-r--r-- | sys/compat/freebsd32/freebsd32_syscalls.c | 2 | ||||
-rw-r--r-- | sys/compat/freebsd32/freebsd32_sysent.c | 4 | ||||
-rw-r--r-- | sys/compat/freebsd32/syscalls.master | 2 | ||||
-rw-r--r-- | sys/kern/kern_thr.c | 6 | ||||
-rw-r--r-- | sys/sys/thr.h | 2 |
8 files changed, 14 insertions, 11 deletions
diff --git a/lib/libthr/thread/thr_exit.c b/lib/libthr/thread/thr_exit.c index f71c59a..3ee5fa5 100644 --- a/lib/libthr/thread/thr_exit.c +++ b/lib/libthr/thread/thr_exit.c @@ -43,7 +43,7 @@ __weak_reference(_pthread_exit, pthread_exit); /* thr_exit() */ -extern int _thr_exit(void); +extern int _thr_exit(long *state); static void deadlist_free_threads(); @@ -164,7 +164,6 @@ _pthread_exit(void *status) deadlist_free_threads(); TAILQ_INSERT_HEAD(&_dead_list, curthread, dle); TAILQ_REMOVE(&_thread_list, curthread, tle); - curthread->isdead = 1; /* If we're the last thread, call it quits */ if (TAILQ_EMPTY(&_thread_list)) @@ -181,7 +180,7 @@ _pthread_exit(void *status) * thread, which we can't be because we've already checked * for that. */ - _thr_exit(); + _thr_exit((long *)&curthread->isdead); /* This point should not be reached. */ PANIC("Dead thread has resumed"); diff --git a/sys/compat/freebsd32/freebsd32_proto.h b/sys/compat/freebsd32/freebsd32_proto.h index d708695..cf0c0bb 100644 --- a/sys/compat/freebsd32/freebsd32_proto.h +++ b/sys/compat/freebsd32/freebsd32_proto.h @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.40 2004/07/14 00:03:30 peter Exp + * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.41 2004/10/06 14:20:57 mtm Exp */ #ifndef _FREEBSD32_SYSPROTO_H_ diff --git a/sys/compat/freebsd32/freebsd32_syscall.h b/sys/compat/freebsd32/freebsd32_syscall.h index 94871fa..ddcd675 100644 --- a/sys/compat/freebsd32/freebsd32_syscall.h +++ b/sys/compat/freebsd32/freebsd32_syscall.h @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.40 2004/07/14 00:03:30 peter Exp + * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.41 2004/10/06 14:20:57 mtm Exp */ #define FREEBSD32_SYS_syscall 0 diff --git a/sys/compat/freebsd32/freebsd32_syscalls.c b/sys/compat/freebsd32/freebsd32_syscalls.c index 2b79d17..08868aa 100644 --- a/sys/compat/freebsd32/freebsd32_syscalls.c +++ b/sys/compat/freebsd32/freebsd32_syscalls.c @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.40 2004/07/14 00:03:30 peter Exp + * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.41 2004/10/06 14:20:57 mtm Exp */ const char *freebsd32_syscallnames[] = { diff --git a/sys/compat/freebsd32/freebsd32_sysent.c b/sys/compat/freebsd32/freebsd32_sysent.c index 21457f3..edb73bb 100644 --- a/sys/compat/freebsd32/freebsd32_sysent.c +++ b/sys/compat/freebsd32/freebsd32_sysent.c @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.40 2004/07/14 00:03:30 peter Exp + * created from FreeBSD: src/sys/compat/freebsd32/syscalls.master,v 1.41 2004/10/06 14:20:57 mtm Exp */ #include "opt_compat.h" @@ -456,7 +456,7 @@ struct sysent freebsd32_sysent[] = { { 0, (sy_call_t *)nosys }, /* 428 = __acl_aclcheck_link */ { 0, (sy_call_t *)nosys }, /* 429 = sigwait */ { SYF_MPSAFE | AS(thr_create_args), (sy_call_t *)thr_create }, /* 430 = thr_create */ - { SYF_MPSAFE | 0, (sy_call_t *)thr_exit }, /* 431 = thr_exit */ + { SYF_MPSAFE | AS(thr_exit_args), (sy_call_t *)thr_exit }, /* 431 = thr_exit */ { SYF_MPSAFE | AS(thr_self_args), (sy_call_t *)thr_self }, /* 432 = thr_self */ { SYF_MPSAFE | AS(thr_kill_args), (sy_call_t *)thr_kill }, /* 433 = thr_kill */ { SYF_MPSAFE | AS(_umtx_lock_args), (sy_call_t *)_umtx_lock }, /* 434 = _umtx_lock */ diff --git a/sys/compat/freebsd32/syscalls.master b/sys/compat/freebsd32/syscalls.master index 1babf95..c2ff8c1 100644 --- a/sys/compat/freebsd32/syscalls.master +++ b/sys/compat/freebsd32/syscalls.master @@ -596,7 +596,7 @@ ; XXX implement 429 UNIMPL sigwait 430 MNOPROTO { int thr_create(ucontext_t *ctx, long *id, int flag s); } -431 MNOPROTO { void thr_exit(void); } +431 MNOPROTO { void thr_exit(long *state); } 432 MNOPROTO { int thr_self(long *id); } 433 MNOPROTO { int thr_kill(long id, int sig); } 434 MNOPROTO { int _umtx_lock(struct umtx *umtx); } diff --git a/sys/kern/kern_thr.c b/sys/kern/kern_thr.c index 6a5f220..402667a 100644 --- a/sys/kern/kern_thr.c +++ b/sys/kern/kern_thr.c @@ -186,12 +186,16 @@ thr_self(struct thread *td, struct thr_self_args *uap) int thr_exit(struct thread *td, struct thr_exit_args *uap) - /* NULL */ + /* long *state */ { struct proc *p; p = td->td_proc; + /* Signal userland that it can free the stack. */ + if ((void *)uap->state != NULL) + suword((void *)uap->state, 1); + PROC_LOCK(p); mtx_lock_spin(&sched_lock); diff --git a/sys/sys/thr.h b/sys/sys/thr.h index ea36af3..4be6d66 100644 --- a/sys/sys/thr.h +++ b/sys/sys/thr.h @@ -39,7 +39,7 @@ int thr_create(ucontext_t *ctx, long *id, int flags); int thr_self(long *id); -void thr_exit(void); +void thr_exit(long *state); int thr_kill(long id, int sig); int thr_suspend(const struct timespec *timeout); int thr_wake(long id); |