X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=src%2Fthread%2Fpthread_create.c;h=627ff5fbbe087cea6782eb8a9703aa389061ff5e;hp=6327a9429155e6ae757c31ed340fe152cdf08e6c;hb=42c36f957d54926eec87b072a73439b9a1539347;hpb=c62b9f39803221e250a490275f4cb23e9f737a6d diff --git a/src/thread/pthread_create.c b/src/thread/pthread_create.c index 6327a942..627ff5fb 100644 --- a/src/thread/pthread_create.c +++ b/src/thread/pthread_create.c @@ -130,7 +130,7 @@ int pthread_create(pthread_t *restrict res, const pthread_attr_t *restrict attr, } tsd = map + size - __pthread_tsd_size; } - new = __copy_tls(tsd - libc.tls_size); + new = __copy_tls(stack = tsd - libc.tls_size); new->map_base = map; new->map_size = size; new->pid = self->pid; @@ -145,7 +145,6 @@ int pthread_create(pthread_t *restrict res, const pthread_attr_t *restrict attr, } new->unblock_cancel = self->cancel; new->canary = self->canary; - stack = (void *)new; a_inc(&libc.threads_minus_1); ret = __clone(start, stack, flags, new, &new->tid, new, &new->tid);