From: Tomohiro Matsuyama <tomo@cx4a.org>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: emacs-devel@gnu.org
Subject: Re: Timer scheduling and cancel-timer
Date: Sun, 31 Mar 2013 20:17:46 +0900 [thread overview]
Message-ID: <20130331201746.cbb41f66c98d4c2be5ad4287@cx4a.org> (raw)
In-Reply-To: <50FC43DB.6070505@cs.ucla.edu>
> On 01/20/2013 07:58 AM, Tomohiro Matsuyama wrote:
> > (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.
>
> Hmm, isn't that due to a race in the above code?
> A timer can fire when a timer action is running.
>
> Do you get zombie timers with the following?
> It should avoid the race.
>
> (setq my-timer
> (run-with-timer
> nil 0.1
> (lambda ()
> (let ((m my-timer))
> (when m
> (cancel-timer m)
> (setq my-timer nil)
> (sit-for 0.3))))))
I still got zombie timers. Same if I replace sit-for with sleep-for.
No one can reproduce this problem?
Regards,
Tomohiro
next prev parent reply other threads:[~2013-03-31 11:17 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-20 15:58 Timer scheduling and cancel-timer Tomohiro Matsuyama
2013-01-20 19:22 ` Paul Eggert
2013-01-20 21:04 ` Drew Adams
2013-01-20 21:35 ` Drew Adams
2013-01-21 1:36 ` Stefan Monnier
2013-01-21 1:39 ` Drew Adams
2013-01-22 3:50 ` Drew Adams
2013-01-22 11:28 ` Stephen Berman
2013-01-22 16:00 ` Stephen Berman
2013-01-22 16:09 ` Bastien
2013-01-23 9:32 ` Bastien
2013-01-23 13:03 ` Stefan Monnier
2013-01-23 13:29 ` Bastien
2013-01-23 20:35 ` Stefan Monnier
2013-01-23 22:01 ` Bastien
2013-01-24 16:32 ` Drew Adams
2013-01-24 19:02 ` Bastien
2013-01-22 13:34 ` Stefan Monnier
2013-01-22 13:57 ` Bastien
2013-01-22 14:14 ` Stefan Monnier
2013-03-31 11:17 ` Tomohiro Matsuyama [this message]
2013-03-31 16:44 ` Michael Heerdegen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130331201746.cbb41f66c98d4c2be5ad4287@cx4a.org \
--to=tomo@cx4a.org \
--cc=eggert@cs.ucla.edu \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.