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

ruby-changes:10051

From: yugui <ko1@a...>
Date: Fri, 16 Jan 2009 13:07:28 +0900 (JST)
Subject: [ruby-changes:10051] Ruby:r21594 (ruby_1_9_1): merges r21582 from trunk into ruby_1_9_1.

yugui	2009-01-16 13:07:04 +0900 (Fri, 16 Jan 2009)

  New Revision: 21594

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

  Log:
    merges r21582 from trunk into ruby_1_9_1.
    * thread.c (rb_thread_execute_interrupts): if signal is already
      buffered, main thread should wait until timer thread delivers it.
    * thread.c (timer_thread_function): should defer delivery of a signal
      if main thread does not yet trap a previous one.  [ruby-dev:37676]

  Modified files:
    branches/ruby_1_9_1/ChangeLog
    branches/ruby_1_9_1/thread.c

Index: ruby_1_9_1/ChangeLog
===================================================================
--- ruby_1_9_1/ChangeLog	(revision 21593)
+++ ruby_1_9_1/ChangeLog	(revision 21594)
@@ -1,3 +1,11 @@
+Fri Jan 16 02:25:46 2009  Yusuke Endoh  <mame@t...>
+
+	* thread.c (rb_thread_execute_interrupts): if signal is already
+	  buffered, main thread should wait until timer thread delivers it.
+
+	* thread.c (timer_thread_function): should defer delivery of a signal
+	  if main thread does not yet trap a previous one.  [ruby-dev:37676]
+
 Fri Jan 16 01:42:50 2009  Koichi Sasada  <ko1@a...>
 
 	* thread.c (call_trace_proc): as Matz said ([ruby-core:21183]),
Index: ruby_1_9_1/thread.c
===================================================================
--- ruby_1_9_1/thread.c	(revision 21593)
+++ ruby_1_9_1/thread.c	(revision 21594)
@@ -1179,6 +1179,10 @@
 void
 rb_thread_execute_interrupts(rb_thread_t *th)
 {
+    if (GET_VM()->main_thread == th) {
+	while (rb_signal_buff_size() && !th->exec_signal) native_thread_yield();
+    }
+
     if (th->raised_flag) return;
 
     while (th->interrupt_flag) {
@@ -2518,13 +2522,14 @@
 {
     rb_vm_t *vm = GET_VM(); /* TODO: fix me for Multi-VM */
     int sig;
+    rb_thread_t *mth;
 
     /* for time slice */
     RUBY_VM_SET_TIMER_INTERRUPT(vm->running_thread);
 
     /* check signal */
-    if ((sig = rb_get_next_signal()) > 0) {
-	rb_thread_t *mth = vm->main_thread;
+    mth = vm->main_thread;
+    if (!mth->exec_signal && (sig = rb_get_next_signal()) > 0) {
 	enum rb_thread_status prev_status = mth->status;
 	thread_debug("main_thread: %s, sig: %d\n",
 		     thread_status_name(prev_status), sig);

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

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