summaryrefslogtreecommitdiff
path: root/ptw32_tkAssocCreate.c
diff options
context:
space:
mode:
authorrpj <rpj>2005-05-08 16:52:50 +0000
committerrpj <rpj>2005-05-08 16:52:50 +0000
commit7395b1431d5e2160682de273b46252c747ccbf36 (patch)
treebcff10e33282212ae087bb5074bc6025fc1313a3 /ptw32_tkAssocCreate.c
parent78f83cfa240ec14874b22c7302ff8d306c130aaf (diff)
''
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 */