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

ruby-changes:20327

From: yugui <ko1@a...>
Date: Sun, 3 Jul 2011 21:23:42 +0900 (JST)
Subject: [ruby-changes:20327] yugui:r32375 (ruby_1_9_2): merges r30272 from trunk into ruby_1_9_2.

yugui	2011-07-03 21:23:28 +0900 (Sun, 03 Jul 2011)

  New Revision: 32375

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

  Log:
    merges r30272 from trunk into ruby_1_9_2.
    --
            * thread.c (thread_cleanup_func): Don't touch native threading
              resource at fork. Sadly this is purely bandaid. We need to
              implement proper fix later. [Bug #4169] [ruby-core:33767]

  Modified files:
    branches/ruby_1_9_2/ChangeLog
    branches/ruby_1_9_2/thread.c
    branches/ruby_1_9_2/version.h

Index: ruby_1_9_2/ChangeLog
===================================================================
--- ruby_1_9_2/ChangeLog	(revision 32374)
+++ ruby_1_9_2/ChangeLog	(revision 32375)
@@ -1,3 +1,9 @@
+Tue Dec 21 00:46:20 2010  KOSAKI Motohiro  <kosaki.motohiro@g...>
+
+	* thread.c (thread_cleanup_func): Don't touch native threading
+	  resource at fork. Sadly this is purely bandaid. We need to
+	  implement proper fix later. [Bug #4169] [ruby-core:33767]
+
 Tue May 24 07:06:34 2011  Hidetoshi NAGAI  <nagai@a...>
 
 	* ext/tk/lib/tk/extconf.rb: search directories for 64bit library (e.g.
Index: ruby_1_9_2/thread.c
===================================================================
--- ruby_1_9_2/thread.c	(revision 32374)
+++ ruby_1_9_2/thread.c	(revision 32375)
@@ -389,12 +389,21 @@
 }
 
 static void
-thread_cleanup_func(void *th_ptr)
+thread_cleanup_func(void *th_ptr, int atfork)
 {
     rb_thread_t *th = th_ptr;
 
     th->locking_mutex = Qfalse;
     thread_cleanup_func_before_exec(th_ptr);
+
+    /*
+     * Unfortunately, we can't release native threading resource at fork
+     * because libc may have unstable locking state therefore touching
+     * a threading resource may cause a deadlock.
+     */
+    if (atfork)
+	return;
+
     native_thread_destroy(th);
 }
 
@@ -524,7 +533,7 @@
 	ruby_cleanup(state);
     }
     else {
-	thread_cleanup_func(th);
+	thread_cleanup_func(th, FALSE);
 	native_mutex_unlock(&th->vm->global_vm_lock);
     }
 
@@ -2776,7 +2785,7 @@
 	    rb_mutex_abandon_all(th->keeping_mutexes);
 	}
 	th->keeping_mutexes = NULL;
-	thread_cleanup_func(th);
+	thread_cleanup_func(th, TRUE);
     }
     return ST_CONTINUE;
 }
Index: ruby_1_9_2/version.h
===================================================================
--- ruby_1_9_2/version.h	(revision 32374)
+++ ruby_1_9_2/version.h	(revision 32375)
@@ -1,13 +1,13 @@
 #define RUBY_VERSION "1.9.2"
-#define RUBY_PATCHLEVEL 274
+#define RUBY_PATCHLEVEL 275
 #define RUBY_VERSION_MAJOR 1
 #define RUBY_VERSION_MINOR 9
 #define RUBY_VERSION_TEENY 1
 
 #define RUBY_RELEASE_YEAR 2011
-#define RUBY_RELEASE_MONTH 6
-#define RUBY_RELEASE_DAY 6
-#define RUBY_RELEASE_DATE "2011-06-06"
+#define RUBY_RELEASE_MONTH 7
+#define RUBY_RELEASE_DAY 3
+#define RUBY_RELEASE_DATE "2011-07-03"
 
 #include "ruby/version.h"
 

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

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