From 784dedc5f06db04b1fd51d30c126508061e05a50 Mon Sep 17 00:00:00 2001 From: ko1 Date: Thu, 4 Jan 2007 01:38:01 +0000 Subject: * thread_pthread.ci : fix to skip using PTHREAD_STACK_MIN. [ruby-dev:30063] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- thread_pthread.ci | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'thread_pthread.ci') diff --git a/thread_pthread.ci b/thread_pthread.ci index 2896e3213b..c2c9d9967f 100644 --- a/thread_pthread.ci +++ b/thread_pthread.ci @@ -179,16 +179,19 @@ native_thread_create(yarv_thread_t *th) } else { pthread_attr_t attr; - size_t stack_size = 512 * 1024 - sizeof(int); /* 512KB */ +#ifdef PTHREAD_STACK_MIN + size_t stack_size = 512 * 1024 - sizeof(int); /* 512KB */ if (stack_size < PTHREAD_STACK_MIN) { stack_size = PTHREAD_STACK_MIN * 2; } - - thread_debug("create: %p, stack size: %ld\n", th, stack_size); +#endif + thread_debug("create: %p, stack size: %ld\n", th, stack_size); pthread_attr_init(&attr); +#ifdef PTHREAD_STACK_MIN pthread_attr_setstacksize(&attr, stack_size); +#endif pthread_attr_setinheritsched(&attr, PTHREAD_INHERIT_SCHED); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); @@ -416,12 +419,16 @@ rb_thread_create_timer_thread(void) rb_enable_interrupt(); if (!timer_thread_id) { +#ifdef PTHREAD_STACK_MIN size_t stack_size = PTHREAD_STACK_MIN; +#endif pthread_attr_t attr; int err; pthread_attr_init(&attr); +#ifdef PTHREAD_STACK_MIN pthread_attr_setstacksize(&attr, stack_size); +#endif pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); err = pthread_create(&timer_thread_id, &attr, thread_timer, 0); if (err != 0) { -- cgit v1.2.3