aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKim F. Storm2004-05-14 20:16:06 +0000
committerKim F. Storm2004-05-14 20:16:06 +0000
commit9af28288fa636a071149fe67604b0f9691423d0c (patch)
tree74ee2ef0bd72a57f8a21e613cfc7fcdb7046bc9e /src
parent93589c1fed7e3ad3b0fc5338d0c33500a3fb0915 (diff)
downloademacs-9af28288fa636a071149fe67604b0f9691423d0c.tar.gz
emacs-9af28288fa636a071149fe67604b0f9691423d0c.zip
(in_timer_check): New static var.
(timer_check): Use it to guard against reentry.
Diffstat (limited to 'src')
-rw-r--r--src/keyboard.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index b9e455a4431..a3fae774431 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -4249,6 +4249,8 @@ struct input_event last_timer_event;
4249 run the timer directly instead of queueing a timer-event. 4249 run the timer directly instead of queueing a timer-event.
4250 Now we always run timers directly. */ 4250 Now we always run timers directly. */
4251 4251
4252static int in_timer_check = 0;
4253
4252EMACS_TIME 4254EMACS_TIME
4253timer_check (do_it_now) 4255timer_check (do_it_now)
4254 int do_it_now; 4256 int do_it_now;
@@ -4261,6 +4263,11 @@ timer_check (do_it_now)
4261 EMACS_SET_SECS (nexttime, -1); 4263 EMACS_SET_SECS (nexttime, -1);
4262 EMACS_SET_USECS (nexttime, -1); 4264 EMACS_SET_USECS (nexttime, -1);
4263 4265
4266 if (in_timer_check)
4267 return nexttime;
4268
4269 in_timer_check = 1;
4270
4264 /* Always consider the ordinary timers. */ 4271 /* Always consider the ordinary timers. */
4265 timers = Vtimer_list; 4272 timers = Vtimer_list;
4266 /* Consider the idle timers only if Emacs is idle. */ 4273 /* Consider the idle timers only if Emacs is idle. */
@@ -4419,6 +4426,7 @@ timer_check (do_it_now)
4419 return the amount of time to wait before it is ripe. */ 4426 return the amount of time to wait before it is ripe. */
4420 { 4427 {
4421 UNGCPRO; 4428 UNGCPRO;
4429 in_timer_check = 0;
4422 return difference; 4430 return difference;
4423 } 4431 }
4424 } 4432 }
@@ -4426,6 +4434,7 @@ timer_check (do_it_now)
4426 /* No timers are pending in the future. */ 4434 /* No timers are pending in the future. */
4427 /* Return 0 if we generated an event, and -1 if not. */ 4435 /* Return 0 if we generated an event, and -1 if not. */
4428 UNGCPRO; 4436 UNGCPRO;
4437 in_timer_check = 0;
4429 return nexttime; 4438 return nexttime;
4430} 4439}
4431 4440