diff options
| author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-08-05 16:31:08 +0000 |
|---|---|---|
| committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-08-05 16:31:08 +0000 |
| commit | eb2ce3dfa5abe6108540ef4ada73a5f4d7583188 (patch) | |
| tree | e00be7beac11eaeeb9b6d94e27eb99d95e512c33 | |
| parent | 699d9a15c4db8eec896c0a09939e42a5593f1a08 (diff) | |
* eval.c (rb_thread_schedule): fix condition for making thread
runnable. [ruby-core:23515]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@24413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | eval.c | 27 |
2 files changed, 19 insertions, 13 deletions
@@ -1,3 +1,8 @@ +Thu Aug 6 01:28:53 2009 Tanaka Akira <akr@fsij.org> + + * eval.c (rb_thread_schedule): fix condition for making thread + runnable. [ruby-core:23515] + Wed Aug 5 12:54:00 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> * eval.c (rb_exc_raise, rb_exc_fatal): require exception object. @@ -11386,25 +11386,26 @@ rb_thread_schedule() } 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; |
