From: John Carter Date: 2009-05-21T08:05:59+09:00 Subject: [ruby-core:23515] [Bug #1499] Commit 22478 has "that can't be right!" defect in rb_thread_schedule. Bug #1499: Commit 22478 has "that can't be right!" defect in rb_thread_schedule. http://redmine.ruby-lang.org/issues/show/1499 Author: John Carter Status: Open, Priority: Normal Assigned to: Shyouhei Urabe ruby -v: ruby 1.8.7 (2009-04-08 patchlevel 160) [i686-linux] http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8_7/eval.c?view=diff&r1=22477&r2=22478 + 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; but but since th == th_found + th_found->wait_for = 0; + if (th->wait_for&WAIT_FD) { means that if is ALWAYS going to fail! I'm not sure what the correct code is... but I'm guessing it is move the th->wait_for = 0 to after the ifs. ---------------------------------------- http://redmine.ruby-lang.org