about summary refs log tree commit diff
path: root/src/thread/pthread_attr_init.c
Commit message (Collapse)AuthorAgeFilesLines
* remove redundant declarations of __default_stacksize, __default_guardsizeRich Felker2018-09-181-3/+0
| | | | these are now declared in pthread_impl.h.
* fix benign data race in pthread_attr_initRich Felker2018-09-181-0/+2
| | | | access to defaults should be protected against concurrent changes.
* make pthread_attr_init honor defaults set by pthread_setattr_default_npRich Felker2018-07-271-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.
* simplify pthread_attr_t stack/guard size representationRich Felker2016-11-071-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.
* include cleanups: remove unused headers and add feature test macrosSzabolcs Nagy2013-12-121-1/+0
|
* clean up sloppy nested inclusion from pthread_impl.hRich Felker2012-11-081-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).
* initial check-in, version 0.5.0 v0.5.0Rich Felker2011-02-121-0/+7