diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | thread_pthread.ci | 13 |
2 files changed, 16 insertions, 4 deletions
@@ -1,6 +1,11 @@ +Thu Jan 04 10:33:54 2007 Koichi Sasada <ko1@atdot.net> + + * thread_pthread.ci : fix to skip using PTHREAD_STACK_MIN. + [ruby-dev:30063] + Thu Jan 04 10:30:11 2007 Koichi Sasada <ko1@atdot.net> - * benchmark/run_rite.rb (bm) : fix to use lines + * benchmark/run_rite.rb (bm) : fix to use lines. Wed Jan 3 18:49:15 2007 Yukihiro Matsumoto <matz@ruby-lang.org> 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) { |