From: Rich Felker Date: Tue, 18 Sep 2018 23:41:03 +0000 (-0400) Subject: fix benign data race in pthread_attr_init X-Git-Tag: v1.1.21~82 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=11ce1b133d594b6a454d3e8d5941e7a6a432c42b;p=oweals%2Fmusl.git fix benign data race in pthread_attr_init access to defaults should be protected against concurrent changes. --- diff --git a/src/thread/pthread_attr_init.c b/src/thread/pthread_attr_init.c index a962b460..398990d1 100644 --- a/src/thread/pthread_attr_init.c +++ b/src/thread/pthread_attr_init.c @@ -6,7 +6,9 @@ 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; }