]> code.delx.au - gnu-emacs/blobdiff - src/atimer.c
(get_adstyle_property): Fix previous change.
[gnu-emacs] / src / atimer.c
index fc7aeb010101e99494256aefcb8a032c6ccd7fe9..e7b23f21b749fe78e6f4db71a08c977c14104905 100644 (file)
@@ -1,13 +1,13 @@
 /* Asynchronous timers.
    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005,
-                 2006, 2007, 2008  Free Software Foundation, Inc.
+                 2006, 2007, 2008, 2009  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
-GNU Emacs is free software; you can redistribute it and/or modify
+GNU Emacs is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 3, or (at your option)
-any later version.
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
 
 GNU Emacs is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,9 +15,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with GNU Emacs; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-Boston, MA 02110-1301, USA.  */
+along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 #include <signal.h>
@@ -370,9 +368,7 @@ run_timers ()
 
       t = atimers;
       atimers = atimers->next;
-#ifndef MAC_OSX
       t->fn (t);
-#endif
 
       if (t->type == ATIMER_CONTINUOUS)
        {
@@ -384,16 +380,25 @@ run_timers ()
          t->next = free_atimers;
          free_atimers = t;
        }
-#ifdef MAC_OSX
-      /* Fix for Ctrl-G.  Perhaps this should apply to all platforms. */
-      t->fn (t); 
-#endif
 
       EMACS_GET_TIME (now);
     }
 
+  if (! atimers)
+    pending_atimers = 0;
+
+#ifdef SYNC_INPUT
+  if (pending_atimers)
+    pending_signals = 1;
+  else
+    {
+      pending_signals = interrupt_input_pending;
+      set_alarm ();
+    }
+#else
   if (! pending_atimers)
     set_alarm ();
+#endif
 }
 
 
@@ -405,7 +410,9 @@ alarm_signal_handler (signo)
      int signo;
 {
   pending_atimers = 1;
-#ifndef SYNC_INPUT
+#ifdef SYNC_INPUT
+  pending_signals = 1;
+#else
   run_timers ();
 #endif
 }
@@ -447,6 +454,7 @@ init_atimer ()
 {
   free_atimers = atimers = NULL;
   pending_atimers = 0;
+  /* pending_signals is initialized in init_keyboard.*/
   signal (SIGALRM, alarm_signal_handler);
 }