diff options
author | davidxu <davidxu@FreeBSD.org> | 2005-10-26 06:55:46 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2005-10-26 06:55:46 +0000 |
commit | 23ec020060d0889d45cd07e2d8f578498aeab4c0 (patch) | |
tree | 10643dea8fac4c97e9990b0c1940052d5bc1d7f2 /sys/kern/kern_umtx.c | |
parent | a16098473846c54b54bd1b74ca434605687746c7 (diff) | |
download | FreeBSD-src-23ec020060d0889d45cd07e2d8f578498aeab4c0.zip FreeBSD-src-23ec020060d0889d45cd07e2d8f578498aeab4c0.tar.gz |
do umtx_wake at userland thread exit address, so that others userland
threads can wait for a thread to exit, and safely assume that the thread
has left userland and is no longer using its userland stack, this is
necessary for pthread_join when a thread is waiting for another thread
to exit which has user customized stack, after pthread_join returns,
the userland stack can be reused for other purposes, without this change,
the joiner thread has to spin at the address to ensure the thread is really
exited.
Diffstat (limited to 'sys/kern/kern_umtx.c')
-rw-r--r-- | sys/kern/kern_umtx.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/kern_umtx.c b/sys/kern/kern_umtx.c index c159487..9c8049e 100644 --- a/sys/kern/kern_umtx.c +++ b/sys/kern/kern_umtx.c @@ -687,8 +687,8 @@ out: return (error); } -static int -do_wake(struct thread *td, void *uaddr, int n_wake) +int +kern_umtx_wake(struct thread *td, void *uaddr, int n_wake) { struct umtx_key key; int ret; @@ -762,7 +762,7 @@ _umtx_op(struct thread *td, struct _umtx_op_args *uap) error = do_wait(td, uap->umtx, uap->id, ts); break; case UMTX_OP_WAKE: - error = do_wake(td, uap->umtx, uap->id); + error = kern_umtx_wake(td, uap->umtx, uap->id); break; default: error = EINVAL; |