mallocng/aligned_alloc: check for malloc failure
[musl] / src / thread / pthread_attr_init.c
index a962b46..463a8d2 100644 (file)
@@ -1,12 +1,11 @@
 #include "pthread_impl.h"
 
-extern size_t __default_stacksize;
-extern size_t __default_guardsize;
-
 int pthread_attr_init(pthread_attr_t *a)
 {
        *a = (pthread_attr_t){0};
+       __acquire_ptc();
        a->_a_stacksize = __default_stacksize;
        a->_a_guardsize = __default_guardsize;
+       __release_ptc();
        return 0;
 }