aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2022-08-09 21:26:21 +0300
committerEli Zaretskii2022-08-09 21:26:21 +0300
commit38f9d9bf060e08f3fe5edab9a13bc7eaabe7e2f1 (patch)
treedebb85e7347faedbbb134e37d5383203846a18c3
parentb7b160b4098949d745e7114bd198653d4e72a70d (diff)
downloademacs-38f9d9bf060e08f3fe5edab9a13bc7eaabe7e2f1.tar.gz
emacs-38f9d9bf060e08f3fe5edab9a13bc7eaabe7e2f1.zip
; * src/keyboard.c (timer_check_2): Restore run-time conditions.
-rw-r--r--src/keyboard.c33
1 files changed, 19 insertions, 14 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index f8e6ef748da..4ad6e4e6bd1 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -4645,24 +4645,29 @@ timer_check_2 (Lisp_Object timers, Lisp_Object idle_timers)
4645 /* If we got here, presumably `decode_timer` has checked 4645 /* If we got here, presumably `decode_timer` has checked
4646 that this timer has not yet been triggered. */ 4646 that this timer has not yet been triggered. */
4647 eassert (NILP (AREF (chosen_timer, 0))); 4647 eassert (NILP (AREF (chosen_timer, 0)));
4648 specpdl_ref count = SPECPDL_INDEX (); 4648 /* In a production build, where assertions compile to
4649 Lisp_Object old_deactivate_mark = Vdeactivate_mark; 4649 nothing, we still want to play it safe here. */
4650 if (NILP (AREF (chosen_timer, 0)))
4651 {
4652 specpdl_ref count = SPECPDL_INDEX ();
4653 Lisp_Object old_deactivate_mark = Vdeactivate_mark;
4650 4654
4651 /* Mark the timer as triggered to prevent problems if the lisp 4655 /* Mark the timer as triggered to prevent problems if the lisp
4652 code fails to reschedule it right. */ 4656 code fails to reschedule it right. */
4653 ASET (chosen_timer, 0, Qt); 4657 ASET (chosen_timer, 0, Qt);
4654 4658
4655 specbind (Qinhibit_quit, Qt); 4659 specbind (Qinhibit_quit, Qt);
4656 4660
4657 call1 (Qtimer_event_handler, chosen_timer); 4661 call1 (Qtimer_event_handler, chosen_timer);
4658 Vdeactivate_mark = old_deactivate_mark; 4662 Vdeactivate_mark = old_deactivate_mark;
4659 timers_run++; 4663 timers_run++;
4660 unbind_to (count, Qnil); 4664 unbind_to (count, Qnil);
4661 4665
4662 /* Since we have handled the event, 4666 /* Since we have handled the event,
4663 we don't need to tell the caller to wake up and do it. */ 4667 we don't need to tell the caller to wake up and do it. */
4664 /* But the caller must still wait for the next timer, so 4668 /* But the caller must still wait for the next timer, so
4665 return 0 to indicate that. */ 4669 return 0 to indicate that. */
4670 }
4666 4671
4667 nexttime = make_timespec (0, 0); 4672 nexttime = make_timespec (0, 0);
4668 break; 4673 break;