diff options
author | Rich Felker <dalias@aerifal.cx> | 2018-09-18 19:41:03 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2018-09-18 19:41:03 -0400 |
commit | 11ce1b133d594b6a454d3e8d5941e7a6a432c42b (patch) | |
tree | 712953df1fcba80fbb47b01bbe34b1521f4d48d8 /src/thread | |
parent | 84d061d5a31c9c773e29e1e2b1ffe8cb9557bc58 (diff) | |
download | musl-11ce1b133d594b6a454d3e8d5941e7a6a432c42b.tar.gz musl-11ce1b133d594b6a454d3e8d5941e7a6a432c42b.tar.bz2 musl-11ce1b133d594b6a454d3e8d5941e7a6a432c42b.tar.xz musl-11ce1b133d594b6a454d3e8d5941e7a6a432c42b.zip |
fix benign data race in pthread_attr_init
access to defaults should be protected against concurrent changes.
Diffstat (limited to 'src/thread')
-rw-r--r-- | src/thread/pthread_attr_init.c | 2 |
1 files changed, 2 insertions, 0 deletions
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; } |