Merge pull request #1064 from urbit/philip/behn

Don't fire timer in the middle of another event and take one timer at a time
This commit is contained in:
Philip Monk 2019-02-09 13:59:51 -08:00 committed by GitHub
commit a74f750dd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -59,9 +59,6 @@
++ wait
|= date=@da
^+ [moves state]
:: process elapsed timers first to maintain sort order
::
=. event-core notify-clients
=. timers.state (set-timer [date duct])
set-wake
:: +wake: unix says we should wake up; notify clients and set :next-wake
@ -92,7 +89,7 @@
::
++ notify-clients
=* timers timers.state
|- ^+ event-core
^+ event-core
::
?~ timers
=. moves (flop moves)
@ -102,10 +99,10 @@
=. moves (flop moves)
event-core
::
%_ $
timers t.timers
moves [[duct.i.timers %give %wake ~] moves]
==
=. moves [[duct.i.timers %give %wake ~] moves]
=> .(timers t.timers)
=. moves (flop moves)
event-core
:: +set-wake: set or unset a unix timer to wake us when next timer expires
::
:: We prepend the unix %doze event so that it is handled first. Arvo must