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

ruby-changes:12697

From: akr <ko1@a...>
Date: Thu, 6 Aug 2009 01:31:27 +0900 (JST)
Subject: [ruby-changes:12697] Ruby:r24413 (ruby_1_8): * eval.c (rb_thread_schedule): fix condition for making thread

akr	2009-08-06 01:31:08 +0900 (Thu, 06 Aug 2009)

  New Revision: 24413

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

  Log:
    * eval.c (rb_thread_schedule): fix condition for making thread
      runnable.  [ruby-core:23515]

  Modified files:
    branches/ruby_1_8/ChangeLog
    branches/ruby_1_8/eval.c

Index: ruby_1_8/ChangeLog
===================================================================
--- ruby_1_8/ChangeLog	(revision 24412)
+++ ruby_1_8/ChangeLog	(revision 24413)
@@ -1,3 +1,8 @@
+Thu Aug  6 01:28:53 2009  Tanaka Akira  <akr@f...>
+
+	* eval.c (rb_thread_schedule): fix condition for making thread
+	  runnable.  [ruby-core:23515]
+
 Wed Aug  5 12:54:00 2009  Nobuyoshi Nakada  <nobu@r...>
 
 	* eval.c (rb_exc_raise, rb_exc_fatal): require exception object.
Index: ruby_1_8/eval.c
===================================================================
--- ruby_1_8/eval.c	(revision 24412)
+++ ruby_1_8/eval.c	(revision 24413)
@@ -11386,25 +11386,26 @@
 	}
 	if ((th->status == THREAD_RUNNABLE || th == th_found) && th->stk_ptr) {
 	    if (!next || next->priority < th->priority) {
-                if (th == th_found) {
-                    th_found->status = THREAD_RUNNABLE;
-                    th_found->wait_for = 0;
-                    if (th->wait_for&WAIT_FD) {
-                        th_found->fd = 0;
-                    }
-                    else { /* th->wait_for&WAIT_SELECT */
-                        n = intersect_fds(&readfds, &th_found->readfds, max) +
-                            intersect_fds(&writefds, &th_found->writefds, max) +
-                            intersect_fds(&exceptfds, &th_found->exceptfds, max);
-                        th_found->select_value = n;
-                    }
-                }
 	        next = th;
             }
 	}
     }
     END_FOREACH_FROM(curr, th);
 
+    if (found && next == th_found) {
+        th_found->status = THREAD_RUNNABLE;
+        if (th->wait_for&WAIT_FD) {
+            th_found->fd = 0;
+        }
+        else { /* th->wait_for&WAIT_SELECT */
+            n = intersect_fds(&readfds, &th_found->readfds, max) +
+                intersect_fds(&writefds, &th_found->writefds, max) +
+                intersect_fds(&exceptfds, &th_found->exceptfds, max);
+            th_found->select_value = n;
+        }
+        th_found->wait_for = 0;
+    }
+
     if (!next) {
 	/* raise fatal error to main thread */
 	curr_thread->node = ruby_current_node;

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

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