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.
10 lines
188 B
C
10 lines
188 B
C
#include "pthread_impl.h"
|
|
|
|
int pthread_attr_init(pthread_attr_t *a)
|
|
{
|
|
*a = (pthread_attr_t){0};
|
|
a->_a_stacksize = DEFAULT_STACK_SIZE;
|
|
a->_a_guardsize = DEFAULT_GUARD_SIZE;
|
|
return 0;
|
|
}
|