Subject: Re: 24.1.50; Stuck in garbage collection on OS X

From: Jan Djärv <[email-masked]>
Date: Sat, 15 Sep 2012 20:59:09 +0200

15 sep 2012 kl. 13:07 skrev Harald Hanche-Olsen <[email-masked]>:

> [Jan Djärv <[email-masked]> (2012-09-15 09:55:55 UTC)]
> 
>> I think this is probably the same bug as in #12326.  I.e. a timer gets added over and over again.
>> Please consider how to fix the original problem as described in http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12326#11 before removing the break statement.
> 
> Thanks for the pointer. There are certainly timers involved in the code that runs when I get the hangs; I'll review it and see if that is where the problem lies.
> 
> However, I am not sure exactly what to look for. Or, more precisely, what is the undefined behaviour in js2-mode that you complain about it bug 12326?
> 

The undefined behaviour was before adding the break, timers could run at a time in the future that depended on other timers.  The defined behaviour is with the break, timers run when they should.

I suspect there is some bug in the C code when adding a timer from within a timer callback.

> On a side note, I see that only a few timer functions are described in the elisp manual. It appears one has to read timer.el to find out how timers work at a lower level. Or did I miss something?

As Eli has answered, the timers are handeled in C as a list sorted by time when the timers are to be run.  I.e. the next timer to run is at the head of the list.

	Jan D.