Project

General

Profile

Actions

Bug #1499

closed

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

Added by JohnCarter (John Carter) over 15 years ago. Updated over 13 years ago.

Status:
Closed
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

Actions #1

Updated by shyouhei (Shyouhei Urabe) over 15 years ago

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

=begin

=end

Actions #2

Updated by akr (Akira Tanaka) about 15 years ago

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

=begin
Applied in changeset r24413.
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0