1 #include "pthread_impl.h"
3 const size_t __pthread_tsd_size = sizeof(void *) * PTHREAD_KEYS_MAX;
5 static void nodtor(void *dummy)
9 int pthread_key_create(pthread_key_t *k, void (*dtor)(void *))
11 static void (*keys[PTHREAD_KEYS_MAX])(void *);
12 unsigned i = (uintptr_t)&k / 16 % PTHREAD_KEYS_MAX;
17 if (!dtor) dtor = nodtor;
19 if (!a_cas_p(keys+j, 0, dtor)) {
23 } while ((j=(j+1)%PTHREAD_KEYS_MAX) != i);