… | … | ||
---|---|---|---|
179 | 179 | ||
180 | our $DELAY_TIMER; | 180 | our $DELAY_TIMER; |
181 | our @DELAY_QUEUE; | 181 | our @DELAY_QUEUE; |
182 | 182 | ||
183 | sub _delay_run { | 183 | sub _delay_run { |
184 | (shift @DELAY_QUEUE or return)->() while 1; | 184 | (shift @DELAY_QUEUE or return undef $DELAY_TIMER)->() while 1; |
185 | undef $DELAY_TIMER; | ||
186 | } | 185 | } |
187 | 186 | ||
188 | sub delay($) { | 187 | sub delay($) { |
189 | push @DELAY_QUEUE, shift; | 188 | push @DELAY_QUEUE, shift; |
190 | $DELAY_TIMER ||= AE::timer 0, 0, \&_delay_run; | 189 | $DELAY_TIMER ||= AE::timer 0, 0, \&_delay_run; |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |