thread_pthread.c: fix for dynamic PTHREAD_STACK_MIN
* thread_pthread.c (rb_thread_create_timer_thread): fix for platforms where PTHREAD_STACK_MIN is a dynamic value and not a compile-time constant. [ruby-dev:47911] [Bug #9436] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44675 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
63da4ce3bc
commit
6802a3f6f2
@ -1,3 +1,9 @@
|
|||||||
|
Tue Jan 21 20:14:55 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* thread_pthread.c (rb_thread_create_timer_thread): fix for platforms
|
||||||
|
where PTHREAD_STACK_MIN is a dynamic value and not a compile-time
|
||||||
|
constant. [ruby-dev:47911] [Bug #9436]
|
||||||
|
|
||||||
Tue Jan 21 17:55:09 2014 Zachary Scott <e@zzak.io>
|
Tue Jan 21 17:55:09 2014 Zachary Scott <e@zzak.io>
|
||||||
|
|
||||||
* lib/uri/common.rb: [DOC] Use static w3.org uri [ci skip]
|
* lib/uri/common.rb: [DOC] Use static w3.org uri [ci skip]
|
||||||
|
@ -1480,17 +1480,15 @@ rb_thread_create_timer_thread(void)
|
|||||||
}
|
}
|
||||||
# ifdef PTHREAD_STACK_MIN
|
# ifdef PTHREAD_STACK_MIN
|
||||||
{
|
{
|
||||||
# define TIMER_THREAD_STACK_MIN_SIZE (4096 * 4)
|
const size_t min_size = (4096 * 4);
|
||||||
/* Allocate the machine stack for the timer thread
|
/* Allocate the machine stack for the timer thread
|
||||||
* at least 16KB (4 pages). FreeBSD 8.2 AMD64 causes
|
* at least 16KB (4 pages). FreeBSD 8.2 AMD64 causes
|
||||||
* machine stack overflow only with PTHREAD_STACK_MIN.
|
* machine stack overflow only with PTHREAD_STACK_MIN.
|
||||||
*/
|
*/
|
||||||
# if TIMER_THREAD_STACK_MIN_SIZE < PTHREAD_STACK_MIN
|
size_t stack_size = PTHREAD_STACK_MIN; /* may be dynamic, get only once */
|
||||||
# undef TIMER_THREAD_STACK_MIN_SIZE
|
if (stack_size < min_size) stack_size = min_size;
|
||||||
# define TIMER_THREAD_STACK_MIN_SIZE PTHREAD_STACK_MIN
|
if (THREAD_DEBUG) stack_size += BUFSIZ;
|
||||||
# endif
|
pthread_attr_setstacksize(&attr, stack_size);
|
||||||
pthread_attr_setstacksize(&attr,
|
|
||||||
TIMER_THREAD_STACK_MIN_SIZE + (THREAD_DEBUG ? BUFSIZ : 0));
|
|
||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user