diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-07-03 05:13:06 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-07-03 05:13:06 +0000 |
commit | 854db4e8654717b86d3f455d6e874cd5ad6fd39d (patch) | |
tree | 16669a520228851c38c9c17e69d2ae6b1b010866 /thread_pthread.c | |
parent | 750e2a7db7bf61b6e28c1472b106112f07048df4 (diff) |
* thread_pthread.c: fixed compile error on linux.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@46669 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread_pthread.c')
-rw-r--r-- | thread_pthread.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/thread_pthread.c b/thread_pthread.c index 11b665fda4..840e6844ab 100644 --- a/thread_pthread.c +++ b/thread_pthread.c @@ -520,6 +520,9 @@ size_t pthread_get_stacksize_np(pthread_t); # define MAINSTACKADDR_AVAILABLE 0 # endif #endif +#if MAINSTACKADDR_AVAILABLE && !defined(get_main_stack) +# define get_main_stack(addr, size) get_stack(addr, size) +#endif #ifdef STACKADDR_AVAILABLE /* @@ -892,7 +895,12 @@ native_thread_create(rb_thread_t *th) thread_debug("create (use cached thread): %p\n", (void *)th); } else { +#ifdef HAVE_PTHREAD_ATTR_INIT pthread_attr_t attr; + pthread_attr_t *const attrp = &attr; +#else + pthread_attr_t *const attrp = NULL; +#endif const size_t stack_size = th->vm->default_params.thread_machine_stack_size; const size_t space = space_size(stack_size); |