[前][次][番号順一覧][スレッド一覧]

ruby-changes:30651

From: nobu <ko1@a...>
Date: Fri, 30 Aug 2013 22:37:52 +0900 (JST)
Subject: [ruby-changes:30651] nobu:r42730 (trunk): thread_pthread.c: get_main_stack

nobu	2013-08-30 22:37:46 +0900 (Fri, 30 Aug 2013)

  New Revision: 42730

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=42730

  Log:
    thread_pthread.c: get_main_stack
    
    * thread_pthread.c (get_main_stack): separate function to get stack of
      main thread.

  Modified files:
    trunk/ChangeLog
    trunk/thread_pthread.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 42729)
+++ ChangeLog	(revision 42730)
@@ -1,3 +1,20 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Fri Aug 30 22:37:40 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* 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@a...>
 
 	* struct.c (rb_struct_define_without_accessor_under): added.
Index: thread_pthread.c
===================================================================
--- thread_pthread.c	(revision 42729)
+++ thread_pthread.c	(revision 42730)
@@ -544,6 +544,9 @@ hpux_attr_getstackaddr(const pthread_att https://github.com/ruby/ruby/blob/trunk/thread_pthread.c#L544
 #   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 https://github.com/ruby/ruby/blob/trunk/thread_pthread.c#L688
 #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;

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]