]> gitweb.factorcode.org Git - factor.git/commitdiff
Merge branch 'master' of git://factorcode.org/git/factor
authorDoug Coleman <doug.coleman@gmail.com>
Sun, 22 Nov 2009 00:16:23 +0000 (18:16 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Sun, 22 Nov 2009 00:16:23 +0000 (18:16 -0600)
1  2 
basis/alarms/alarms.factor

index b006131182bf2a506f32267da8fd8e89150d7344,251d82eec8f096704be879493699c5f599cfda64..b006131182bf2a506f32267da8fd8e89150d7344
mode 100755,100644..100644
@@@ -19,15 -19,13 +19,15 @@@ SYMBOL: alarm-threa
  : notify-alarm-thread ( -- )
      alarm-thread get-global interrupt ;
  
 -: normalize-argument ( obj -- nanoseconds )
 -    >duration duration>nanoseconds >integer ;
 +GENERIC: >nanoseconds ( obj -- duration/f )
 +M: f >nanoseconds ;
 +M: real >nanoseconds >integer ;
 +M: duration >nanoseconds duration>nanoseconds >integer ;
  
  : <alarm> ( quot start interval -- alarm )
      alarm new
 -        swap dup [ normalize-argument ] when >>interval
 -        swap dup [ normalize-argument nano-count + ] when >>start
 +        swap >nanoseconds >>interval
 +        swap >nanoseconds nano-count + >>start
          swap >>quot
          <box> >>entry ;