summaryrefslogtreecommitdiffstats
path: root/lib/libc_r/uthread/pthread_private.h
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/libc_r/uthread/pthread_private.h
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/libc_r/uthread/pthread_private.h')
-rw-r--r--lib/libc_r/uthread/pthread_private.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/libc_r/uthread/pthread_private.h b/lib/libc_r/uthread/pthread_private.h
index 151fd03..b60d8b7 100644
--- a/lib/libc_r/uthread/pthread_private.h
+++ b/lib/libc_r/uthread/pthread_private.h
@@ -601,6 +601,11 @@ struct pthread_state_data {
/* XXX - What about thread->timeout and/or thread->error? */
};
+struct join_status {
+ struct pthread *thread;
+ int ret;
+ int error;
+};
/*
* Normally thread contexts are stored as jmp_bufs via _setjmp()/_longjmp(),
@@ -757,8 +762,12 @@ struct pthread {
*/
int error;
- /* Pointer to a thread that is waiting to join (NULL if no joiner). */
- struct pthread *joiner;
+ /*
+ * The joiner is the thread that is joining to this thread. The
+ * join status keeps track of a join operation to another thread.
+ */
+ struct pthread *joiner;
+ struct join_status join_status;
/*
* The current thread can belong to only one scheduling queue at
OpenPOWER on IntegriCloud