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

ruby-changes:17941

From: nobu <ko1@a...>
Date: Sun, 28 Nov 2010 14:46:38 +0900 (JST)
Subject: [ruby-changes:17941] Ruby:r29957 (trunk): * thread_pthread.c (gvl_reinit): register atfork hander only in

nobu	2010-11-28 14:46:32 +0900 (Sun, 28 Nov 2010)

  New Revision: 29957

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

  Log:
    * thread_pthread.c (gvl_reinit): register atfork hander only in
      the parent process, to get rid of dead lock.

  Modified files:
    trunk/ChangeLog
    trunk/thread_pthread.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 29956)
+++ ChangeLog	(revision 29957)
@@ -1,3 +1,8 @@
+Sun Nov 28 14:46:24 2010  Nobuyoshi Nakada  <nobu@r...>
+
+	* thread_pthread.c (gvl_reinit): register atfork hander only in
+	  the parent process, to get rid of dead lock.
+
 Sun Nov 28 12:23:57 2010  Koichi Sasada  <ko1@a...>
 
 	* thread.c, vm_core.h: make gvl_acquire/release/init/destruct
Index: thread_pthread.c
===================================================================
--- thread_pthread.c	(revision 29956)
+++ thread_pthread.c	(revision 29957)
@@ -132,22 +132,26 @@
 #endif
 }
 
-static void gvl_init(rb_vm_t *vm);
+static void gvl_reinit(rb_vm_t *vm);
 
 static void
 gvl_atfork_child(void)
 {
-    gvl_init(GET_VM());
+    gvl_reinit(GET_VM());
 }
 
 static void
 gvl_init(rb_vm_t *vm)
 {
-    int r;
     if (GVL_DEBUG) fprintf(stderr, "gvl init\n");
-    native_mutex_initialize(&vm->gvl.lock);
     native_atfork(0, 0, gvl_atfork_child);
+    gvl_reinit(vm);
+}
 
+static void
+gvl_reinit(rb_vm_t *vm)
+{
+    native_mutex_initialize(&vm->gvl.lock);
     vm->gvl.waiting_threads = 0;
     vm->gvl.waiting_last_thread = 0;
     vm->gvl.waiting = 0;

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

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