emacs-devel
[Top][All Lists]
Advanced

[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>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]