X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=src%2Fthread%2Fpthread_key_create.c;h=e51cb02325d4908a8ac91b58d6b6afde47a5af6d;hp=fa8a65412e5f3ec178840dd4fd56e3ac4bace135;hb=dba68bf98fc708cea4c478278c889fc7ad802b00;hpb=537d33d33478034b62928e5cacf397b049ac78ab diff --git a/src/thread/pthread_key_create.c b/src/thread/pthread_key_create.c index fa8a6541..e51cb023 100644 --- a/src/thread/pthread_key_create.c +++ b/src/thread/pthread_key_create.c @@ -14,7 +14,7 @@ int pthread_key_create(pthread_key_t *k, void (*dtor)(void *)) unsigned i = (uintptr_t)&k / 16 % PTHREAD_KEYS_MAX; unsigned j = i; - pthread_self(); + __pthread_self_init(); if (!dtor) dtor = nodtor; do { if (!a_cas_p(keys+j, 0, dtor)) { @@ -31,8 +31,9 @@ int pthread_key_delete(pthread_key_t k) return 0; } -void __pthread_tsd_run_dtors(pthread_t self) +void __pthread_tsd_run_dtors() { + pthread_t self = __pthread_self(); int i, j, not_finished = self->tsd_used; for (j=0; not_finished && j