Changeset 189

Show
Ignore:
Timestamp:
06/03/06 15:15:12 (3 years ago)
Author:
blackhedd
Message:

removed a potential infinite loop.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • experiments/NewMachine/lib/machine/reactor.rb

    r185 r189  
    88  require 'singleton' 
    99 
     10  # TODO: Sooner or later, someone will figure out how to construct 
     11  # a situation in which an event is pended but has to wait for half 
     12  # a second while the select loop in EventableIO times out. 
     13  # That's the point of the "event-signal" which is implemented here 
     14  # but commented out for the moment. We create a socketpair that 
     15  # gets written to when an event is queued on any dispatcher. That 
     16  # drops the EventableIO dispatcher out of its select loop. 
     17  # Uncomment the implementation when we come up with a test case 
     18  # that needs it. 
    1019  class Reactor 
    1120    include LogSupport 
     
    5059    # dispatchers blocks. Typically this will be the selectable-IO dispatcher. 
    5160    def iterate 
    52       log.debug "iterating..." 
    53       @dispatchers.each {|d| d.iterate
     61      log.debug "iterating #{@dispatchers.size} dispatchers..." 
     62      @dispatchers.each {|d| d.iterate if running?
    5463      #@signalled = false 
    5564    end