]> code.delx.au - gnu-emacs/blobdiff - src/atimer.c
Fix Qnone definition in NS files.
[gnu-emacs] / src / atimer.c
index 6767ee59c0e1a8d2e3b6b1e9bad3ef6004fb1461..432e2590dad83d7ccb26acd51c9228b42fb03e85 100644 (file)
@@ -1,6 +1,6 @@
 /* Asynchronous timers.
    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005,
-                 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
+                 2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -20,6 +20,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include <config.h>
 #include <signal.h>
 #include <stdio.h>
+#include <setjmp.h>
 #include <lisp.h>
 #include <syssignal.h>
 #include <systime.h>
@@ -384,6 +385,10 @@ run_timers ()
       EMACS_GET_TIME (now);
     }
 
+  if (! atimers)
+    pending_atimers = 0;
+
+#ifdef SYNC_INPUT
   if (pending_atimers)
     pending_signals = 1;
   else
@@ -391,6 +396,10 @@ run_timers ()
       pending_signals = interrupt_input_pending;
       set_alarm ();
     }
+#else
+  if (! pending_atimers)
+    set_alarm ();
+#endif
 }
 
 
@@ -401,9 +410,14 @@ SIGTYPE
 alarm_signal_handler (signo)
      int signo;
 {
+#ifndef SYNC_INPUT
+  SIGNAL_THREAD_CHECK (signo);
+#endif
+
   pending_atimers = 1;
+#ifdef SYNC_INPUT
   pending_signals = 1;
-#ifndef SYNC_INPUT
+#else
   run_timers ();
 #endif
 }
@@ -443,7 +457,7 @@ turn_on_atimers (on)
 void
 init_atimer ()
 {
-  free_atimers = atimers = NULL;
+  free_atimers = stopped_atimers = atimers = NULL;
   pending_atimers = 0;
   /* pending_signals is initialized in init_keyboard.*/
   signal (SIGALRM, alarm_signal_handler);