summaryrefslogtreecommitdiff
path: root/accel-pppd
diff options
context:
space:
mode:
authorKozlov Dmitry <xeb@mail.ru>2012-08-03 16:36:07 +0400
committerKozlov Dmitry <xeb@mail.ru>2012-08-03 16:36:07 +0400
commit6f9d8f7b04763df492b239ffe6f18ff91ed17c16 (patch)
treefb3fa863bc2b225f913036b2200d50deea90c4e9 /accel-pppd
parent3dad610b772ba53eb2c50baa7b2760c65de94213 (diff)
parent994905a05a6388cb9e832e09c05bb6a363c73ecc (diff)
downloadaccel-ppp-xebd-6f9d8f7b04763df492b239ffe6f18ff91ed17c16.tar.gz
accel-ppp-xebd-6f9d8f7b04763df492b239ffe6f18ff91ed17c16.zip
Merge branch '1.7' of ssh://accel-ppp.git.sourceforge.net/gitroot/accel-ppp/accel-ppp into 1.7
Diffstat (limited to 'accel-pppd')
-rw-r--r--accel-pppd/triton/triton.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/accel-pppd/triton/triton.c b/accel-pppd/triton/triton.c
index 897a4ea..cf06cea 100644
--- a/accel-pppd/triton/triton.c
+++ b/accel-pppd/triton/triton.c
@@ -10,11 +10,10 @@
#include "triton_p.h"
#include "memdebug.h"
-#define WORKER_STACK_SIZE 1024*1024
-
int thread_count = 2;
int thread_count_max = 200;
int max_events = 64;
+int conf_stack_size = 1024*1024;
static spinlock_t threads_lock = SPINLOCK_INITIALIZER;
static LIST_HEAD(threads);
@@ -247,7 +246,7 @@ struct _triton_thread_t *create_thread()
}
pthread_attr_init(&attr);
- pthread_attr_setstacksize(&attr, WORKER_STACK_SIZE);
+ pthread_attr_setstacksize(&attr, conf_stack_size);
memset(thread, 0, sizeof(*thread));
pthread_mutex_init(&thread->sleep_lock, NULL);
@@ -622,6 +621,10 @@ void __export triton_run()
if (opt && atoi(opt) > 0)
thread_count_max = atoi(opt);
+ opt = conf_get_opt("core", "stack-size");
+ if (opt && atoi(opt) > 0)
+ conf_stack_size = atoi(opt);
+
for(i = 0; i < thread_count; i++) {
t = create_thread();
if (!t)