summaryrefslogtreecommitdiff
path: root/thread_pthread.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-30 13:37:46 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-30 13:37:46 +0000
commit7703ba8544c485b1ae1fcafbdff1566e9d78a7a2 (patch)
tree25f44ac64f6348148a7145413da9e6994d8a46fa /thread_pthread.c
parent51f09f15c354972fb0a342217ad7d18e9613e02d (diff)
downloadruby-7703ba8544c485b1ae1fcafbdff1566e9d78a7a2.tar.gz
thread_pthread.c: get_main_stack
* thread_pthread.c (get_main_stack): separate function to get stack of main thread. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42730 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread_pthread.c')
-rw-r--r--thread_pthread.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/thread_pthread.c b/thread_pthread.c
index 1e6b80ae49..19b3fb790f 100644
--- a/thread_pthread.c
+++ b/thread_pthread.c
@@ -544,6 +544,9 @@ hpux_attr_getstackaddr(const pthread_attr_t *attr, void *addr)
# 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
/*
@@ -685,7 +688,7 @@ ruby_init_stack(volatile VALUE *addr
#if MAINSTACKADDR_AVAILABLE
void* stackaddr;
STACK_GROW_DIR_DETECTION;
- if (get_stack(&stackaddr, &size) == 0) {
+ if (get_main_stack(&stackaddr, &size) == 0) {
space = STACK_DIR_UPPER((char *)addr - (char *)stackaddr, (char *)stackaddr - (char *)addr);
}
native_main_thread.stack_maxsize = size - space;