projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
84d061d
)
fix benign data race in pthread_attr_init
author
Rich Felker
<dalias@aerifal.cx>
Tue, 18 Sep 2018 23:41:03 +0000
(19:41 -0400)
committer
Rich Felker
<dalias@aerifal.cx>
Tue, 18 Sep 2018 23:41:03 +0000
(19:41 -0400)
access to defaults should be protected against concurrent changes.
src/thread/pthread_attr_init.c
patch
|
blob
|
history
diff --git
a/src/thread/pthread_attr_init.c
b/src/thread/pthread_attr_init.c
index a962b46080608acf8f20288f36ff6bab9537d11a..398990d19f214f7c78f18d09259270508740a944 100644
(file)
--- 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;
}