diff options
author | deischen <deischen@FreeBSD.org> | 2002-03-06 19:28:41 +0000 |
---|---|---|
committer | deischen <deischen@FreeBSD.org> | 2002-03-06 19:28:41 +0000 |
commit | 760bec0aa09d3c5d6260ec595a1158a587aebc3a (patch) | |
tree | f340718e38ac9a4f173cf51ddb7eedc39288a0fd /lib/libpthread/thread | |
parent | 7a594117fc66a44ba461a0e00ae4a76964fc9ac4 (diff) | |
download | FreeBSD-src-760bec0aa09d3c5d6260ec595a1158a587aebc3a.zip FreeBSD-src-760bec0aa09d3c5d6260ec595a1158a587aebc3a.tar.gz |
Properly clear the status of a join operation if the joining thread is
canceled or the joinee is detached.
Diffstat (limited to 'lib/libpthread/thread')
-rw-r--r-- | lib/libpthread/thread/thr_cancel.c | 1 | ||||
-rw-r--r-- | lib/libpthread/thread/thr_detach.c | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/libpthread/thread/thr_cancel.c b/lib/libpthread/thread/thr_cancel.c index 4c6ca98..cf72d89 100644 --- a/lib/libpthread/thread/thr_cancel.c +++ b/lib/libpthread/thread/thr_cancel.c @@ -70,6 +70,7 @@ _pthread_cancel(pthread_t pthread) if (pthread->join_status.thread != NULL) { pthread->join_status.thread->joiner = NULL; + pthread->join_status.thread = NULL; } pthread->cancelflags |= PTHREAD_CANCELLING; PTHREAD_NEW_STATE(pthread, PS_RUNNING); diff --git a/lib/libpthread/thread/thr_detach.c b/lib/libpthread/thread/thr_detach.c index b0e6fc4..298fdb4 100644 --- a/lib/libpthread/thread/thr_detach.c +++ b/lib/libpthread/thread/thr_detach.c @@ -66,7 +66,9 @@ _pthread_detach(pthread_t pthread) PTHREAD_NEW_STATE(joiner, PS_RUNNING); /* Set the return value for the woken thread: */ - joiner->error = ESRCH; + joiner->join_status.error = ESRCH; + joiner->join_status.ret = NULL; + joiner->join_status.thread = NULL; /* * Disconnect the joiner from the thread being detached: |