X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fthread%2Fpthread_key_create.c;h=a78e507a6fc9a9708140e96929a6a572a4e27601;hb=733d1ea759119bcd0554f25034d1b4113b910900;hp=198ae56efd8999469133a9ed77d979feba4956c8;hpb=56fbaa3bbe73f12af2bfbbcf2adb196e6f9fe264;p=musl diff --git a/src/thread/pthread_key_create.c b/src/thread/pthread_key_create.c index 198ae56e..a78e507a 100644 --- a/src/thread/pthread_key_create.c +++ b/src/thread/pthread_key_create.c @@ -13,13 +13,11 @@ int __pthread_key_create(pthread_key_t *k, void (*dtor)(void *)) { unsigned i = (uintptr_t)&k / 16 % PTHREAD_KEYS_MAX; unsigned j = i; + pthread_t self = __pthread_self(); - if (libc.has_thread_pointer) { - pthread_t self = __pthread_self(); - /* This can only happen in the main thread before - * pthread_create has been called. */ - if (!self->tsd) self->tsd = __pthread_tsd_main; - } + /* This can only happen in the main thread before + * pthread_create has been called. */ + if (!self->tsd) self->tsd = __pthread_tsd_main; if (!dtor) dtor = nodtor; do {