summaryrefslogtreecommitdiff
path: root/src/thread/pthread_attr_init.c
AgeCommit message (Collapse)AuthorLines
2018-09-18remove redundant declarations of __default_stacksize, __default_guardsizeRich Felker-3/+0
these are now declared in pthread_impl.h.
2018-09-18fix benign data race in pthread_attr_initRich Felker-0/+2
access to defaults should be protected against concurrent changes.
2018-07-27make pthread_attr_init honor defaults set by pthread_setattr_default_npRich Felker-2/+5
this fixes a major gap in the intended functionality of pthread_setattr_default_np. if application/library code creating a thread does not pass a null attribute pointer to pthread_create, but sets up an attribute object to change other properties while leaving the stack alone, the created thread will get a stack with size DEFAULT_STACK_SIZE. this makes pthread_setattr_default_np useless for working around stack overflow issues in such applications, and leaves a major risk of regression if previously-working code switches from using a null attribute pointer to an attribute object. this change aligns the behavior more closely with the glibc pthread_setattr_default_np functionality too, albeit via a different mechanism. glibc encodes "default" specially in the attribute object and reads the actual default at thread creation time. with this commit, we now copy the current default into the attribute object at pthread_attr_init time, so that applications that query the properties of the attribute object will see the right values.
2016-11-07simplify pthread_attr_t stack/guard size representationRich Felker-0/+2
previously, the pthread_attr_t object was always initialized all-zero, and stack/guard size were represented as differences versus their defaults. this required lots of confusing offset arithmetic everywhere they were used. instead, have pthread_attr_init fill in the default values, and work with absolute sizes everywhere.
2013-12-12include cleanups: remove unused headers and add feature test macrosSzabolcs Nagy-1/+0
2012-11-08clean up sloppy nested inclusion from pthread_impl.hRich Felker-1/+2
this mirrors the stdio_impl.h cleanup. one header which is not strictly needed, errno.h, is left in pthread_impl.h, because since pthread functions return their error codes rather than using errno, nearly every single pthread function needs the errno constants. in a few places, rather than bringing in string.h to use memset, the memset was replaced by direct assignment. this seems to generate much better code anyway, and makes many functions which were previously non-leaf functions into leaf functions (possibly eliminating a great deal of bloat on some platforms where non-leaf functions require ugly prologue and/or epilogue).
2011-02-12initial check-in, version 0.5.0v0.5.0Rich Felker-0/+7