Change alarm start variable to store nano-count of start time instead of (nano-count + interval)

db4
Doug Coleman 2010-05-21 13:28:03 -05:00
parent f3c9eab1f5
commit 547746db9f
1 changed files with 3 additions and 3 deletions

View File

@ -30,12 +30,12 @@ M: duration >nanoseconds duration>nanoseconds >integer ;
: <alarm> ( quot start interval -- alarm ) : <alarm> ( quot start interval -- alarm )
alarm new alarm new
swap >nanoseconds >>interval swap >nanoseconds >>interval
swap >nanoseconds nano-count + nano-count >>start
[ >>start ] [ >>iteration-scheduled ] bi swap >nanoseconds over start>> + >>iteration-scheduled
swap >>quot ; inline swap >>quot ; inline
: register-alarm ( alarm -- ) : register-alarm ( alarm -- )
dup start>> alarms get-global heap-push* drop dup iteration-scheduled>> alarms get-global heap-push* drop
notify-alarm-thread ; notify-alarm-thread ;
: alarm-expired? ( alarm n -- ? ) : alarm-expired? ( alarm n -- ? )