From b43c906fd478d13c3c092a2c7ba3198b5557eac6 Mon Sep 17 00:00:00 2001 From: deischen Date: Sat, 17 Nov 2001 14:28:39 +0000 Subject: Fix pthread_join so that it works if the target thread exits while the joining thread is in a signal handler. Reported by: Loren James Rittle MFC after: 1 week --- lib/libpthread/thread/thr_exit.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/libpthread/thread/thr_exit.c') diff --git a/lib/libpthread/thread/thr_exit.c b/lib/libpthread/thread/thr_exit.c index 9376350..d916f5c 100644 --- a/lib/libpthread/thread/thr_exit.c +++ b/lib/libpthread/thread/thr_exit.c @@ -220,8 +220,9 @@ _pthread_exit(void *status) } /* Set the return value for the joining thread: */ - pthread->ret = curthread->ret; - pthread->error = 0; + pthread->join_status.ret = curthread->ret; + pthread->join_status.error = 0; + pthread->join_status.thread = NULL; /* Make this thread collectable by the garbage collector. */ PTHREAD_ASSERT(((curthread->attr.flags & PTHREAD_DETACHED) == -- cgit v1.1