aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan Djärv <[email protected]>2008-04-09 06:46:02 +0000
committerJan Djärv <[email protected]>2008-04-09 06:46:02 +0000
commit170c80bed42b58e346befd5b8c6f73a5b9d047b7 (patch)
tree97a0b4aabea53705cb4ac586a0461500cc668016 /src
parent799224fe61c0e65c9d0ac2107ec8eed8d898c679 (diff)
(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.
Diffstat (limited to 'src')
-rw-r--r--src/atimer.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/src/atimer.c b/src/atimer.c
index f5f5f34f16..fc7aeb0101 100644
--- a/src/atimer.c
+++ b/src/atimer.c
@@ -355,20 +355,12 @@ schedule_atimer (t)
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 @@ alarm_signal_handler (signo)
}
+/* 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 @@ do_pending_atimers ()
if (pending_atimers)
{
BLOCK_ATIMERS;
- alarm_signal_handler (SIGALRM);
+ run_timers ();
UNBLOCK_ATIMERS;
}
}