diff options
author | rpj <rpj> | 1998-07-25 14:51:07 +0000 |
---|---|---|
committer | rpj <rpj> | 1998-07-25 14:51:07 +0000 |
commit | 514f53305f6c42256c672d552aa9d477c1266163 (patch) | |
tree | ff027b426b1d85512fe3105a9937ffb472413a4a /sync.c | |
parent | ee95385721e0dbd4ba637e78b30101f1c9d24e75 (diff) |
Sun Jul 26 00:09:59 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* condvar.c (cond_wait): Add cancelation point. This applies the
point to both pthread_cond_wait() and pthread_cond_timedwait().
* exit.c (pthread_exit): Rename "this" to "us".
* implement.h: Add comment.
* sync.c (pthread_join): I've satisfied myself that pthread_detach()
does set the detached attribute in the thread entry attributes
to PTHREAD_CREATE_DETACHED. "if" conditions were changed to test
that attribute instead of a separate flag.
* create.c (pthread_create): Rename "this" to "us".
(pthread_create): cancelstate and canceltype are not attributes
so the copy to thread entry attribute storage was removed.
Only the thread itself can change it's cancelstate or canceltype,
ie. the thread must exist already.
Diffstat (limited to 'sync.c')
-rw-r--r-- | sync.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -116,7 +116,7 @@ pthread_join(pthread_t thread, void ** valueptr) following critical section. */ /* CRITICAL SECTION */ - pthread_mutex_lock(target_thread_mutex); + pthread_mutex_lock(&_pthread_count_mutex); /* Collect the value pointer passed to pthread_exit(). If another thread detaches our target thread while we're @@ -124,7 +124,8 @@ pthread_join(pthread_t thread, void ** valueptr) pointed to by target->joinvalueptr has been freed or otherwise no longer valid. */ - if (target->detach == TRUE) + if (pthread_attr_getdetachedstate(&(target->attr), &detachstate) != 0 + || detachstate == PTHREAD_CREATE_DETACHED) { ret = EDEADLK; } @@ -143,7 +144,7 @@ pthread_join(pthread_t thread, void ** valueptr) _pthread_delete_thread_entry(target); } - pthread_mutex_lock(target_thread_mutex); + pthread_mutex_lock(&_pthread_count_mutex); /* END CRITICAL SECTION */ return ret; |