summaryrefslogtreecommitdiff
path: root/thread_pthread.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-11-23 07:06:54 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-11-23 07:06:54 +0000
commita80eb26a188db79decadb82a459754c344dcf5a5 (patch)
treebc8e70c2852896359b521ef1c84faa08627354d7 /thread_pthread.c
parent5a7c9df5b5af15a1dff214af787a4dbfbd96b3c5 (diff)
* thread_pthread.c (RUBY_STACK_MIN, RUBY_STACK_SPACE): delay for
platforms where PTHREAD_STACK_MIN is not compile time constant. [ruby-dev:39751] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25889 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread_pthread.c')
-rw-r--r--thread_pthread.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/thread_pthread.c b/thread_pthread.c
index c8ee4e1272..0d37a12130 100644
--- a/thread_pthread.c
+++ b/thread_pthread.c
@@ -463,15 +463,17 @@ enum {
#else
RUBY_STACK_MIN_LIMIT = 512 * 1024, /* 512KB */
#endif
- RUBY_STACK_MIN = (
+ RUBY_STACK_SPACE_LIMIT = 1024 * 1024
+};
+
#ifdef PTHREAD_STACK_MIN
- (RUBY_STACK_MIN_LIMIT < PTHREAD_STACK_MIN) ? PTHREAD_STACK_MIN * 2 :
+#define RUBY_STACK_MIN ((RUBY_STACK_MIN_LIMIT < PTHREAD_STACK_MIN) ? \
+ PTHREAD_STACK_MIN * 2 : RUBY_STACK_MIN_LIMIT)
+#else
+#define RUBY_STACK_MIN (RUBY_STACK_MIN_LIMIT)
#endif
- RUBY_STACK_MIN_LIMIT),
- RUBY_STACK_SPACE_LIMIT = 1024 * 1024,
- RUBY_STACK_SPACE = (RUBY_STACK_MIN/5 > RUBY_STACK_SPACE_LIMIT ?
- RUBY_STACK_SPACE_LIMIT : RUBY_STACK_MIN/5)
-};
+#define RUBY_STACK_SPACE (RUBY_STACK_MIN/5 > RUBY_STACK_SPACE_LIMIT ? \
+ RUBY_STACK_SPACE_LIMIT : RUBY_STACK_MIN/5)
static int
native_thread_create(rb_thread_t *th)