Simplify main thread stack size initialization

Change-Id: Iec09433d9de501031cce09dc75848a5e8f3d96bf
This commit is contained in:
Brian Carlstrom
2013-09-13 16:34:43 -07:00
parent 322e7bce23
commit 50af69e8f3
3 changed files with 18 additions and 19 deletions

View File

@@ -30,16 +30,10 @@
#include "pthread_internal.h"
// Traditionally we give threads a 1MiB stack. When we started allocating per-thread
// alternate signal stacks to ease debugging of stack overflows, we subtracted the
// same amount we were using there from the default thread stack size. This should
// keep memory usage roughly constant.
#define DEFAULT_THREAD_STACK_SIZE ((1 * 1024 * 1024) - SIGSTKSZ)
int pthread_attr_init(pthread_attr_t* attr) {
attr->flags = 0;
attr->stack_base = NULL;
attr->stack_size = DEFAULT_THREAD_STACK_SIZE;
attr->stack_size = PTHREAD_STACK_SIZE_DEFAULT;
attr->guard_size = PAGE_SIZE;
attr->sched_policy = SCHED_NORMAL;
attr->sched_priority = 0;