Fix latent bug in os-timer.rkt

This commit is contained in:
Tony Garnock-Jones 2012-04-12 15:16:53 -04:00
parent 8f2b4834fc
commit 0fbca40653
1 changed files with 5 additions and 7 deletions

View File

@ -117,14 +117,12 @@
(subscribe 'timer-relay-up
(meta-message-handlers (relay-state next-counter active-timers)
[(timer-expired (list (== self-id) counter) now)
(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)]))
(transition (relay-state next-counter (hash-remove active-timers counter))
(if (hash-has-key? active-timers counter)
(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)))]))))