From 22e44c762bf77aefe988ed7b6874054f84f95b75 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Thu, 28 Jul 2016 10:58:10 -0700 Subject: More rules engine work: key/value pair matching for microsegmentation. --- osdep/Thread.hpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'osdep') diff --git a/osdep/Thread.hpp b/osdep/Thread.hpp index 4f90dc0b..9f6fb5a8 100644 --- a/osdep/Thread.hpp +++ b/osdep/Thread.hpp @@ -126,12 +126,17 @@ public: { memset(&_tid,0,sizeof(_tid)); pthread_attr_init(&_tattr); -#ifdef __LINUX__ - pthread_attr_setstacksize(&_tattr,8388608); // for MUSL libc and others, has no effect in normal glibc environments -#endif + // This corrects for systems with abnormally small defaults (musl) and also + // shrinks the stack on systems with large defaults to save a bit of memory. + pthread_attr_setstacksize(&_tattr,524288); _started = false; } + ~Thread() + { + pthread_attr_destroy(&_tattr); + } + Thread(const Thread &t) throw() { -- cgit v1.2.3