diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-01-04 01:38:01 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-01-04 01:38:01 +0000 |
commit | 784dedc5f06db04b1fd51d30c126508061e05a50 (patch) | |
tree | 191ebf0dddaaa91e2824855b73cdb882be2c6bd6 /thread_pthread.ci | |
parent | a7911f55a4fc59d8d460b15b5e19cc17f0d725d5 (diff) | |
download | ruby-784dedc5f06db04b1fd51d30c126508061e05a50.tar.gz |
* 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
Diffstat (limited to 'thread_pthread.ci')
-rw-r--r-- | thread_pthread.ci | 13 |
1 files changed, 10 insertions, 3 deletions
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) { |