timer: Dispatch the whole timer in the main block.
This commit is contained in:
parent
3386942ce2
commit
49c376dbf6
8
Timer.st
8
Timer.st
|
@ -125,7 +125,7 @@ bit difficult to do this race free.'>
|
|||
|
||||
(Delay forSeconds: 1) wait.
|
||||
now := DateTime now.
|
||||
self fireTimers: now.
|
||||
OsmoDispatcher dispatchBlock: [self fireTimers: now].
|
||||
]
|
||||
]
|
||||
|
||||
|
@ -143,7 +143,11 @@ bit difficult to do this race free.'>
|
|||
copy do: [:each |
|
||||
each timeout > now ifTrue: [^true].
|
||||
sem critical: [queue remove: each].
|
||||
OsmoDispatcher dispatchBlock: [each fire].
|
||||
[
|
||||
each fire
|
||||
] on: Error do: [:e |
|
||||
e logException: 'Execution of timer failed: %1' % {e tag} area: #timer.
|
||||
].
|
||||
].
|
||||
]
|
||||
]
|
||||
|
|
Reference in New Issue