aboutsummaryrefslogtreecommitdiffstats
path: root/thread_pthread.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-21 07:26:46 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-01-21 07:26:46 +0000
commita4963d464bd01ae0f487f999dbc9c2b6e39369b9 (patch)
tree2c52199fc82ed885aa67f1c800a6029be13983ef /thread_pthread.c
parent6cfa67afe75e7d2c7d1178ed8a9a30fa6b9a594c (diff)
downloadruby-a4963d464bd01ae0f487f999dbc9c2b6e39369b9.tar.gz
thread_pthread.c: timer thread stack size
* thread_pthread.c (rb_thread_create_timer_thread): define the stack size for timer thread at compile time. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44670 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread_pthread.c')
-rw-r--r--thread_pthread.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/thread_pthread.c b/thread_pthread.c
index 57daa3b45d..76f033771c 100644
--- a/thread_pthread.c
+++ b/thread_pthread.c
@@ -1479,17 +1479,18 @@ rb_thread_create_timer_thread(void)
exit(EXIT_FAILURE);
}
# ifdef PTHREAD_STACK_MIN
- if (PTHREAD_STACK_MIN < 4096 * 3) {
+ {
+# define TIMER_THREAD_STACK_MIN_SIZE (4096 * 3)
/* Allocate the machine stack for the timer thread
- * at least 12KB (3 pages). FreeBSD 8.2 AMD64 causes
- * machine stack overflow only with PTHREAD_STACK_MIN.
+ * at least 12KB (3 pages). FreeBSD 8.2 AMD64 causes
+ * machine stack overflow only with PTHREAD_STACK_MIN.
*/
+# if TIMER_THREAD_STACK_MIN_SIZE < PTHREAD_STACK_MIN
+# undef TIMER_THREAD_STACK_MIN_SIZE
+# define TIMER_THREAD_STACK_MIN_SIZE PTHREAD_STACK_MIN
+# endif
pthread_attr_setstacksize(&attr,
- 4096 * 3 + (THREAD_DEBUG ? BUFSIZ : 0));
- }
- else {
- pthread_attr_setstacksize(&attr,
- PTHREAD_STACK_MIN + (THREAD_DEBUG ? BUFSIZ : 0));
+ TIMER_THREAD_STACK_MIN_SIZE + (THREAD_DEBUG ? BUFSIZ : 0);
}
# endif
#endif