mirror of git://git.musl-libc.org/musl
fix benign data race in pthread_attr_init
access to defaults should be protected against concurrent changes.
This commit is contained in:
parent
84d061d5a3
commit
11ce1b133d
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue