Changeset 144

Show
Ignore:
Timestamp:
05/26/06 13:00:40 (3 years ago)
Author:
rosejn
Message:

Adding new signal handler code, and also found bug in timer code where periodic timers were missing one event.

Files:

Legend:

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

    r137 r144  
    2929  require 'machine/timeout' 
    3030  require 'machine/eio'  
    31 #  require 'machine/signal' 
     31  require 'machine/signal' 
    3232end 
  • experiments/machine/lib/machine/timeout.rb

    r137 r144  
    5050       
    5151      # An an event handler to re-register if its periodic 
    52       add_handler(self, :register_timer) if @periodic 
     52      add_handler(:timer_expired, self, :register_timer) if @periodic 
    5353       
    5454      register_timer 
  • experiments/machine/test/timeout_test.rb

    r138 r144  
    3232    @reactor.run 
    3333    assert_equal 1, t1, "Regular block timer did not fire." 
    34     assert_equal 2, t2, "Periodic block timer did not fire enough." 
     34    assert_equal 3, t2, "Periodic block timer did not fire enough." 
    3535    assert_equal 1, @t3, "Method based timer did not fire." 
    3636  end