make arch __clone backends hidden
[musl] / src / thread / pthread_create.c
index 2c066cf..dc869dc 100644 (file)
@@ -165,8 +165,8 @@ static void *dummy_tsd[1] = { 0 };
 weak_alias(dummy_tsd, __pthread_tsd_main);
 
 volatile int __block_new_threads = 0;
-size_t __default_stacksize = DEFAULT_STACK_SIZE;
-size_t __default_guardsize = DEFAULT_GUARD_SIZE;
+extern size_t __default_stacksize;
+extern size_t __default_guardsize;
 
 static FILE *volatile dummy_file = 0;
 weak_alias(dummy_file, __stdin_used);
@@ -178,8 +178,6 @@ static void init_file_lock(FILE *f)
        if (f && f->lock<0) f->lock = 0;
 }
 
-void *__copy_tls(unsigned char *);
-
 int __pthread_create(pthread_t *restrict res, const pthread_attr_t *restrict attrp, void *(*entry)(void *), void *restrict arg)
 {
        int ret, c11 = (attrp == __ATTRP_C11_THREAD);
@@ -306,6 +304,7 @@ int __pthread_create(pthread_t *restrict res, const pthread_attr_t *restrict att
 
        if (do_sched) {
                __futexwait(&ssa.futex, -1, 1);
+               ret = ssa.futex;
                if (ret) return ret;
        }