changeset 93894:065fbf6b6fd0

(alarm_signal_handler): Call run_timers if not SYNC_INPUT. Most of the code moved to run_timers. (do_pending_atimers): Call run_timers. (run_timers): New function.
author Jan Djärv <jan.h.d@swipnet.se>
date Wed, 09 Apr 2008 06:46:02 +0000
parents ff99dcb2b31b
children ed8ccfc592a8
files src/atimer.c
diffstat 1 files changed, 17 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/atimer.c	Wed Apr 09 06:15:13 2008 +0000
+++ b/src/atimer.c	Wed Apr 09 06:46:02 2008 +0000
@@ -355,20 +355,12 @@
   t->next = a;
 }
 
-
-/* Signal handler for SIGALRM.  SIGNO is the signal number, i.e.
-   SIGALRM.  */
-
-SIGTYPE
-alarm_signal_handler (signo)
-     int signo;
+static void
+run_timers ()
 {
   EMACS_TIME now;
 
-  SIGNAL_THREAD_CHECK (signo);
-
   EMACS_GET_TIME (now);
-  pending_atimers = 0;
 
   while (atimers
 	 && (pending_atimers = interrupt_input_blocked) == 0
@@ -405,6 +397,20 @@
 }
 
 
+/* Signal handler for SIGALRM.  SIGNO is the signal number, i.e.
+   SIGALRM.  */
+
+SIGTYPE
+alarm_signal_handler (signo)
+     int signo;
+{
+  pending_atimers = 1;
+#ifndef SYNC_INPUT
+  run_timers ();
+#endif
+}
+
+
 /* Call alarm_signal_handler for pending timers.  */
 
 void
@@ -413,7 +419,7 @@
   if (pending_atimers)
     {
       BLOCK_ATIMERS;
-      alarm_signal_handler (SIGALRM);
+      run_timers ();
       UNBLOCK_ATIMERS;
     }
 }