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

ruby-changes:20228

From: ko1 <ko1@a...>
Date: Wed, 29 Jun 2011 06:23:56 +0900 (JST)
Subject: [ruby-changes:20228] ko1:r32276 (trunk): * thread_pthread.c (native_stop_timer_thread): skip to close

ko1	2011-06-29 06:23:40 +0900 (Wed, 29 Jun 2011)

  New Revision: 32276

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

  Log:
    * thread_pthread.c (native_stop_timer_thread): skip to close
      communication pipe to avoid timing bug (process termination timing).
      The communication pipe will closed by OS.

  Modified files:
    trunk/ChangeLog
    trunk/thread_pthread.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 32275)
+++ ChangeLog	(revision 32276)
@@ -1,3 +1,9 @@
+Wed Jun 29 06:21:02 2011  Koichi Sasada  <ko1@a...>
+
+	* thread_pthread.c (native_stop_timer_thread): skip to close
+	  communication pipe to avoid timing bug (process termination timing).
+	  The communication pipe will closed by OS.
+
 Wed Jun 29 06:09:54 2011  Koichi Sasada  <ko1@a...>
 
 	* error.c (rb_async_bug_errno): async-safe bug report function.
Index: thread_pthread.c
===================================================================
--- thread_pthread.c	(revision 32275)
+++ thread_pthread.c	(revision 32276)
@@ -1189,10 +1189,13 @@
 	/* close communication pipe */
 	if (close_anyway) {
 	    /* TODO: Uninstall all signal handlers or mask all signals.
-	     *       This pass is cleaning phase.  It is too rare case
-             *       to generate problem, so we remains it in TODO.
+	     *       This pass is cleaning phase (terminate ruby process).
+	     *       To avoid such race, we skip to close communication
+	     *       pipe.  OS will close it at process termination.
+	     *       It may not good practice, but pragmatic.
+	     *       We remain it is TODO.
 	     */
-	    close_communication_pipe();
+	    /* close_communication_pipe(); */
 	}
     }
     return stopped;

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

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