From 7395b1431d5e2160682de273b46252c747ccbf36 Mon Sep 17 00:00:00 2001 From: rpj Date: Sun, 8 May 2005 16:52:50 +0000 Subject: '' --- ptw32_tkAssocCreate.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) (limited to 'ptw32_tkAssocCreate.c') diff --git a/ptw32_tkAssocCreate.c b/ptw32_tkAssocCreate.c index 10d6527..5ba24bb 100644 --- a/ptw32_tkAssocCreate.c +++ b/ptw32_tkAssocCreate.c @@ -40,8 +40,7 @@ int -ptw32_tkAssocCreate (ThreadKeyAssoc ** assocP, - ptw32_thread_t * sp, pthread_key_t key) +ptw32_tkAssocCreate (ptw32_thread_t * sp, pthread_key_t key) /* * ------------------------------------------------------------------- * This routine creates an association that @@ -61,8 +60,6 @@ ptw32_tkAssocCreate (ThreadKeyAssoc ** assocP, * 2) * * Parameters: - * assocP - * address into which the association is returned. * thread * current running thread. * key @@ -97,27 +94,25 @@ ptw32_tkAssocCreate (ThreadKeyAssoc ** assocP, /* * Register assoc with key */ - if (key->threads != NULL) + assoc->prevThread = NULL; + assoc->nextThread = (ThreadKeyAssoc *) key->threads; + if (assoc->nextThread != NULL) { - ((ThreadKeyAssoc *)key->threads)->prevThread = assoc; + assoc->nextThread->prevThread = assoc; } - assoc->nextThread = (ThreadKeyAssoc *) key->threads; - assoc->prevThread = NULL; key->threads = (void *) assoc; /* * Register assoc with thread */ - if (sp->keys != NULL) + assoc->prevKey = NULL; + assoc->nextKey = (ThreadKeyAssoc *) sp->keys; + if (assoc->nextKey != NULL) { - ((ThreadKeyAssoc *)sp->keys)->prevKey = assoc; + assoc->nextKey->prevKey = assoc; } - assoc->nextKey = (ThreadKeyAssoc *) sp->keys; - assoc->prevKey = NULL; sp->keys = (void *) assoc; - *assocP = assoc; - return (0); } /* ptw32_tkAssocCreate */ -- cgit v1.2.3