summaryrefslogtreecommitdiff
path: root/ptw32_tkAssocCreate.c
diff options
context:
space:
mode:
Diffstat (limited to 'ptw32_tkAssocCreate.c')
-rw-r--r--ptw32_tkAssocCreate.c23
1 files changed, 9 insertions, 14 deletions
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 */