diff options
author | Arne H Juul <arnej@yahooinc.com> | 2021-11-15 13:13:21 +0000 |
---|---|---|
committer | Arne H Juul <arnej@yahooinc.com> | 2021-11-15 13:13:21 +0000 |
commit | 159dc93308eccd375ea33f3bf6d3d6ab1f5813fc (patch) | |
tree | e243dc1104933301fb2778db41575c7741598373 /fastos | |
parent | 776f0ec4a9ddc44e492a7eeb9f82f914bbdf4709 (diff) |
ignore requested stack sizes
* for C++ threads only
* triggered by feature flag, by default use old behavior
Diffstat (limited to 'fastos')
-rw-r--r-- | fastos/src/vespa/fastos/unix_thread.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/fastos/src/vespa/fastos/unix_thread.cpp b/fastos/src/vespa/fastos/unix_thread.cpp index d7a0ed879c0..a45d90426ef 100644 --- a/fastos/src/vespa/fastos/unix_thread.cpp +++ b/fastos/src/vespa/fastos/unix_thread.cpp @@ -71,7 +71,12 @@ bool FastOS_UNIX_Thread::Initialize (int stackSize, int stackGuardSize) #else adjusted_stack_size += PTHREAD_STACK_MIN; #endif - pthread_attr_setstacksize(&attr, adjusted_stack_size); + if (getenv("VESPA_IGNORE_REQUESTED_STACK_SIZES") == nullptr) { + //fprintf(stderr, "pthread_create: using adjusted stack size %zd\n", adjusted_stack_size); + pthread_attr_setstacksize(&attr, adjusted_stack_size); + } else { + //fprintf(stderr, "pthread_create: ignoring requested stack size %d\n", stackSize); + } rc = (0 == pthread_create(&_handle, &attr, FastOS_ThreadHook, this)); if (rc) |