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

ruby-changes:25830

From: ko1 <ko1@a...>
Date: Tue, 27 Nov 2012 12:04:51 +0900 (JST)
Subject: [ruby-changes:25830] ko1:r37887 (trunk): * thread.c (rb_thread_terminate_all): broadcast terminate event

ko1	2012-11-27 12:04:36 +0900 (Tue, 27 Nov 2012)

  New Revision: 37887

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

  Log:
    * thread.c (rb_thread_terminate_all): broadcast terminate event
      not only an interrupt exception but any exceptions.

  Modified files:
    trunk/ChangeLog
    trunk/thread.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 37886)
+++ ChangeLog	(revision 37887)
@@ -1,3 +1,8 @@
+Tue Nov 27 12:02:25 2012  Koichi Sasada  <ko1@a...>
+
+	* thread.c (rb_thread_terminate_all): broadcast terminate event
+	  not only an interrupt exception but any exceptions.
+
 Tue Nov 27 10:55:09 2012  KOSAKI Motohiro  <kosaki.motohiro@g...>
 
 	* eval.c (ruby_cleanup): set thread status to THREAD_KILLED
Index: thread.c
===================================================================
--- thread.c	(revision 37886)
+++ thread.c	(revision 37887)
@@ -378,28 +378,19 @@
     /* unlock all locking mutexes */
     rb_threadptr_unlock_all_locking_mutexes(th);
 
-
     vm->inhibit_thread_creation = 1;
 
-  retry:
-    thread_debug("rb_thread_terminate_all (main thread: %p)\n", (void *)th);
-    st_foreach(vm->living_threads, terminate_i, (st_data_t)th);
-
     while (!rb_thread_alone()) {
 	int state;
+	thread_debug("rb_thread_terminate_all (main thread: %p)\n", (void *)th);
+	st_foreach(vm->living_threads, terminate_i, (st_data_t)th);
 
-	PUSH_TAG();
-	if ((state = EXEC_TAG()) == 0) {
-	    th = GET_THREAD();
+	TH_PUSH_TAG(th);
+	if ((state = TH_EXEC_TAG()) == 0) {
 	    native_sleep(th, 0);
 	    RUBY_VM_CHECK_INTS_BLOCKING(th);
 	}
-	POP_TAG();
-
-	/* broadcast eTerminateSignal again if Ctrl-C was pressed. */
-	if (state && rb_obj_is_kind_of(GET_THREAD()->errinfo, rb_eInterrupt)) {
-	    goto retry;
-	}
+	TH_POP_TAG();
     }
 }
 

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

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