[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Timer scheduling and cancel-timer
From: |
Tomohiro Matsuyama |
Subject: |
Timer scheduling and cancel-timer |
Date: |
Mon, 21 Jan 2013 00:58:02 +0900 |
Hi,
I have found a problem that cancel-timer will not work in a particular
situation where the timer takes more time to execute than a
rescheduling interval of the timer. Here is the reproducible code:
(setq my-timer
(run-with-timer
nil 0.1
(lambda ()
(when my-timer
(cancel-timer my-timer)
(setq my-timer nil)
(sit-for 0.3)))))
After evaluating this code several times, you may see "zombie" timers
in timer-list, though the code intends to keep at most one timer.
As my quick look, the problem may be caused by timer_check in
keyboard.c by firing the timer twice at the same time, that makes the
timer remain in timer-list though the timer has been canceled.
Regards,
Tomohiro
--
Tomohiro Matsuyama <address@hidden>
- Timer scheduling and cancel-timer,
Tomohiro Matsuyama <=
- Re: Timer scheduling and cancel-timer, Paul Eggert, 2013/01/20
- RE: Timer scheduling and cancel-timer, Drew Adams, 2013/01/20
- RE: Timer scheduling and cancel-timer, Drew Adams, 2013/01/20
- Re: Timer scheduling and cancel-timer, Stefan Monnier, 2013/01/20
- RE: Timer scheduling and cancel-timer, Drew Adams, 2013/01/20
- RE: Timer scheduling and cancel-timer, Drew Adams, 2013/01/21
- Re: Timer scheduling and cancel-timer, Stephen Berman, 2013/01/22
- Re: Timer scheduling and cancel-timer, Stephen Berman, 2013/01/22
- Re: Timer scheduling and cancel-timer, Bastien, 2013/01/22
- Re: Timer scheduling and cancel-timer, Bastien, 2013/01/23