diff --git a/src/thread/default_attr.c b/src/thread/default_attr.c new file mode 100644 index 0000000000000000000000000000000000000000..46fe98ee5ce29449c5fabc43a113c5f689970291 --- /dev/null +++ b/src/thread/default_attr.c @@ -0,0 +1,4 @@ +#include "pthread_impl.h" + +size_t __default_stacksize = DEFAULT_STACK_SIZE; +size_t __default_guardsize = DEFAULT_GUARD_SIZE; diff --git a/src/thread/pthread_attr_init.c b/src/thread/pthread_attr_init.c index 8f6e337452bc57ab95b00d030a5e7c7a95ac8390..a962b46080608acf8f20288f36ff6bab9537d11a 100644 --- a/src/thread/pthread_attr_init.c +++ b/src/thread/pthread_attr_init.c @@ -1,9 +1,12 @@ #include "pthread_impl.h" +extern size_t __default_stacksize; +extern size_t __default_guardsize; + 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; + a->_a_stacksize = __default_stacksize; + a->_a_guardsize = __default_guardsize; return 0; } diff --git a/src/thread/pthread_create.c b/src/thread/pthread_create.c index 2c066cffffe5c222457f456b34da0de36815d5b1..2df2e9f9d63663a8bf1589c0ddace0f7eb04753d 100644 --- a/src/thread/pthread_create.c +++ b/src/thread/pthread_create.c @@ -165,8 +165,8 @@ static void *dummy_tsd[1] = { 0 }; weak_alias(dummy_tsd, __pthread_tsd_main); volatile int __block_new_threads = 0; -size_t __default_stacksize = DEFAULT_STACK_SIZE; -size_t __default_guardsize = DEFAULT_GUARD_SIZE; +extern size_t __default_stacksize; +extern size_t __default_guardsize; static FILE *volatile dummy_file = 0; weak_alias(dummy_file, __stdin_used);