1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
ko1 2007-01-04 01:38:01 +00:00
parent a7911f55a4
commit 784dedc5f0
2 changed files with 16 additions and 4 deletions

View file

@ -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>

View file

@ -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) {