Commit 16c463d2 authored by Sergey Lyubka's avatar Sergey Lyubka

Added compile-time option to set stack size

parent 6a995180
...@@ -1397,8 +1397,11 @@ int mg_start_thread(mg_thread_func_t func, void *param) { ...@@ -1397,8 +1397,11 @@ int mg_start_thread(mg_thread_func_t func, void *param) {
(void) pthread_attr_init(&attr); (void) pthread_attr_init(&attr);
(void) pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); (void) pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
// TODO(lsm): figure out why mongoose dies on Linux if next line is enabled
// (void) pthread_attr_setstacksize(&attr, sizeof(struct mg_connection) * 5); #if USE_STACK_SIZE > 1
// Compile-time option to control stack size, e.g. -DUSE_STACK_SIZE=16384
(void) pthread_attr_setstacksize(&attr, USE_STACK_SIZE);
#endif
result = pthread_create(&thread_id, &attr, func, param); result = pthread_create(&thread_id, &attr, func, param);
pthread_attr_destroy(&attr); pthread_attr_destroy(&attr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment