summaryrefslogtreecommitdiffstats
path: root/lib/libpthread/thread/thr_exit.c
diff options
context:
space:
mode:
authordeischen <deischen@FreeBSD.org>2001-11-17 14:28:39 +0000
committerdeischen <deischen@FreeBSD.org>2001-11-17 14:28:39 +0000
commitb43c906fd478d13c3c092a2c7ba3198b5557eac6 (patch)
treed9b490926b6ae401659e2052a1b89c5bea09c6d4 /lib/libpthread/thread/thr_exit.c
parent82943ba6834c1d4951740dd6dd59a8ff1373b2f8 (diff)
downloadFreeBSD-src-b43c906fd478d13c3c092a2c7ba3198b5557eac6.zip
FreeBSD-src-b43c906fd478d13c3c092a2c7ba3198b5557eac6.tar.gz
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 <rittle@labs.mot.com> MFC after: 1 week
Diffstat (limited to 'lib/libpthread/thread/thr_exit.c')
-rw-r--r--lib/libpthread/thread/thr_exit.c5
1 files changed, 3 insertions, 2 deletions
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) ==
OpenPOWER on IntegriCloud