* thread_pthread.c (native_thread_init_stack): suppress warnings.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2008-06-17 12:58:31 +00:00
parent a9934cb098
commit 42eabfcca2
1 changed files with 4 additions and 2 deletions

View File

@ -229,13 +229,15 @@ native_thread_init_stack(rb_thread_t *th)
else {
#ifdef HAVE_PTHREAD_GETATTR_NP
pthread_attr_t attr;
void *start;
CHECK_ERR(pthread_getattr_np(curr, &attr));
# if defined HAVE_PTHREAD_ATTR_GETSTACK
CHECK_ERR(pthread_attr_getstack(&attr, &th->machine_stack_start, &th->machine_stack_maxsize));
CHECK_ERR(pthread_attr_getstack(&attr, &start, &th->machine_stack_maxsize));
# elif defined HAVE_PTHREAD_ATTR_GETSTACKSIZE && defined HAVE_PTHREAD_ATTR_GETSTACKADDR
CHECK_ERR(pthread_attr_getstackaddr(&attr, &th->machine_stack_start));
CHECK_ERR(pthread_attr_getstackaddr(&attr, &start));
CHECK_ERR(pthread_attr_getstacksize(&attr, &th->machine_stack_maxsize));
# endif
th->machine_stack_start = start;
#else
rb_raise(rb_eNotImpError, "ruby engine can initialize only in the main thread");
#endif