Change alarm start variable to store nano-count of start time instead of (nano-count + interval)
parent
f3c9eab1f5
commit
547746db9f
|
@ -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 -- ? )
|
||||||
|
|
Loading…
Reference in New Issue