diff options
author | rpj <rpj> | 2004-11-03 01:08:41 +0000 |
---|---|---|
committer | rpj <rpj> | 2004-11-03 01:08:41 +0000 |
commit | ec8290acdaea21b16d98f1ef5d4ae8a28ab2109a (patch) | |
tree | 0bd3750ec1cc12594b6cfe69473e393da6ec101b /ptw32_callUserDestroyRoutines.c | |
parent | cccaf0c2c82e78a72d69a4a50c872f308bed2f65 (diff) |
Mutex, semaphore, thread ID, test suite changes - see ChangeLogs
Diffstat (limited to 'ptw32_callUserDestroyRoutines.c')
-rw-r--r-- | ptw32_callUserDestroyRoutines.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/ptw32_callUserDestroyRoutines.c b/ptw32_callUserDestroyRoutines.c index 90b0b73..081a60d 100644 --- a/ptw32_callUserDestroyRoutines.c +++ b/ptw32_callUserDestroyRoutines.c @@ -69,7 +69,7 @@ ptw32_callUserDestroyRoutines (pthread_t thread) ThreadKeyAssoc * assoc; - if (thread != NULL) + if (thread.p != NULL) { /* * Run through all Thread<-->Key associations @@ -82,7 +82,7 @@ ptw32_callUserDestroyRoutines (pthread_t thread) * by the current thread and must be released; otherwise * the assoc will be destroyed when the key is destroyed. */ - nextP = (ThreadKeyAssoc **) & (thread->keys); + nextP = (ThreadKeyAssoc **) &((ptw32_thread_t *)thread.p)->keys; assoc = *nextP; while (assoc != NULL) @@ -90,8 +90,9 @@ ptw32_callUserDestroyRoutines (pthread_t thread) if (pthread_mutex_lock (&(assoc->lock)) == 0) { - pthread_key_t - k; + pthread_key_t k; + pthread_t nil = {NULL, 0}; + if ((k = assoc->key) != NULL) { /* @@ -101,8 +102,7 @@ ptw32_callUserDestroyRoutines (pthread_t thread) * key is valid and we can call the destroy * routine; */ - void * - value = NULL; + void * value = NULL; value = pthread_getspecific (k); if (value != NULL && k->destructor != NULL) @@ -146,7 +146,7 @@ ptw32_callUserDestroyRoutines (pthread_t thread) * mark assoc->thread as NULL to indicate the * thread no longer references this association */ - assoc->thread = NULL; + assoc->thread = nil; /* * Remove association from the pthread_t chain |