123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- #include <stdlib.h>
- #include "pthread.h"
- #include "implement.h"
- void
- pte_tkAssocDestroy (ThreadKeyAssoc * assoc)
- {
-
- if (assoc != NULL)
- {
- ThreadKeyAssoc * prev, * next;
-
- prev = assoc->prevKey;
- next = assoc->nextKey;
- if (prev != NULL)
- {
- prev->nextKey = next;
- }
- if (next != NULL)
- {
- next->prevKey = prev;
- }
- if (assoc->thread->keys == assoc)
- {
-
- assoc->thread->keys = next;
- }
- if (assoc->thread->nextAssoc == assoc)
- {
-
- assoc->thread->nextAssoc = next;
- }
-
- prev = assoc->prevThread;
- next = assoc->nextThread;
- if (prev != NULL)
- {
- prev->nextThread = next;
- }
- if (next != NULL)
- {
- next->prevThread = prev;
- }
- if (assoc->key->threads == assoc)
- {
-
- assoc->key->threads = next;
- }
- free (assoc);
- }
- }
|