mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
thread_pthread.c: dup code
* thread_pthread.c (get_stack): merge duplicated code split by ifdef. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
50b17c701f
commit
b7aa49b9a7
1 changed files with 1 additions and 2 deletions
|
@ -532,12 +532,11 @@ get_stack(void **addr, size_t *size)
|
|||
CHECK_ERR(pthread_attr_get_np(pthread_self(), &attr));
|
||||
# ifdef HAVE_PTHREAD_ATTR_GETSTACK
|
||||
CHECK_ERR(pthread_attr_getstack(&attr, addr, size));
|
||||
STACK_DIR_UPPER((void)0, (void)(*addr = (char *)*addr + *size));
|
||||
# else
|
||||
CHECK_ERR(pthread_attr_getstackaddr(&attr, addr));
|
||||
CHECK_ERR(pthread_attr_getstacksize(&attr, size));
|
||||
STACK_DIR_UPPER((void)0, (void)(*addr = (char *)*addr + *size));
|
||||
# endif
|
||||
STACK_DIR_UPPER((void)0, (void)(*addr = (char *)*addr + *size));
|
||||
pthread_attr_destroy(&attr);
|
||||
#elif (defined HAVE_PTHREAD_GET_STACKADDR_NP && defined HAVE_PTHREAD_GET_STACKSIZE_NP) /* MacOS X */
|
||||
pthread_t th = pthread_self();
|
||||
|
|
Loading…
Add table
Reference in a new issue