summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog17
-rw-r--r--thread_pthread.c5
2 files changed, 21 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index a7683a09e9..be866048be 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+Fri Aug 30 22:37:40 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * thread_pthread.c (get_main_stack): separate function to get stack of
+ main thread.
+
+ * thread_pthread.c (native_thread_init_stack): wait the creator thread
+ to fill machine stack info, if get_stack_of() is available.
+
+ * thread_pthread.c (native_thread_create): fill the created thread
+ stack info after starting, if get_stack_of() is available.
+
+ * thread_pthread.c (native_thread_create): define attr only if it is
+ used, and merge pthread_create() calls.
+
+ * thread_pthread.c (get_main_stack): separate function to get stack of
+ main thread.
+
Thu Aug 29 18:05:33 2013 Koichi Sasada <ko1@atdot.net>
* struct.c (rb_struct_define_without_accessor_under): added.
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;