Project

General

Profile

Bug #1499

Commit 22478 has "that can't be right!" defect in rb_thread_schedule.

Added by JohnCarter (John Carter) over 10 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
ruby -v:
ruby 1.8.7 (2009-04-08 patchlevel 160) [i686-linux]
[ruby-core:23515]

Description

=begin
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.
=end

History

#1

Updated by shyouhei (Shyouhei Urabe) about 10 years ago

  • Assignee changed from shyouhei (Shyouhei Urabe) to nobu (Nobuyoshi Nakada)

=begin

=end

#2

Updated by akr (Akira Tanaka) about 10 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
Applied in changeset r24413.
=end

Also available in: Atom PDF