summaryrefslogtreecommitdiff
path: root/osdep
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2016-07-28 10:58:10 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2016-07-28 10:58:10 -0700
commit22e44c762bf77aefe988ed7b6874054f84f95b75 (patch)
treea2d74fba00ad11308524be4561d065b4609cb774 /osdep
parent1e6e112806903009643aef0a2f3736821c1a54d2 (diff)
downloadinfinitytier-22e44c762bf77aefe988ed7b6874054f84f95b75.tar.gz
infinitytier-22e44c762bf77aefe988ed7b6874054f84f95b75.zip
More rules engine work: key/value pair matching for microsegmentation.
Diffstat (limited to 'osdep')
-rw-r--r--osdep/Thread.hpp11
1 files changed, 8 insertions, 3 deletions
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()
{