Fix latent bug in os-timer.rkt
This commit is contained in:
parent
8f2b4834fc
commit
0fbca40653
10
os-timer.rkt
10
os-timer.rkt
|
@ -117,14 +117,12 @@
|
|||
(subscribe 'timer-relay-up
|
||||
(meta-message-handlers (relay-state next-counter active-timers)
|
||||
[(timer-expired (list (== self-id) counter) now)
|
||||
(transition (relay-state next-counter (hash-remove active-timers counter))
|
||||
(if (hash-has-key? active-timers counter)
|
||||
(transition (relay-state next-counter
|
||||
(hash-remove active-timers counter))
|
||||
(send-message (timer-expired (hash-ref active-timers counter) now)))
|
||||
active-timers)]))
|
||||
(send-message (timer-expired (hash-ref active-timers counter) now))
|
||||
'()))]))
|
||||
(subscribe 'timer-relay-down
|
||||
(message-handlers (relay-state next-counter active-timers)
|
||||
[(set-timer label msecs kind)
|
||||
(transition (relay-state (+ next-counter 1)
|
||||
(hash-set active-timers next-counter label))
|
||||
(transition (relay-state (+ next-counter 1) (hash-set active-timers next-counter label))
|
||||
(send-meta-message (set-timer (list self-id next-counter) msecs kind)))]))))
|
||||
|
|
Loading…
Reference in New Issue