emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master fa52782f5c: Make timer_check even more resilient


From: Lars Ingebrigtsen
Subject: master fa52782f5c: Make timer_check even more resilient
Date: Fri, 29 Apr 2022 08:15:23 -0400 (EDT)

branch: master
commit fa52782f5c4eaef7138534766dfc8a29465785b2
Author: Pip Cet <pipcet@gmail.com>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Make timer_check even more resilient
    
    * src/keyboard.c (timer_check): Inhibit atimers while making the
    copy of the timer list (bug#21380).  This prevents an extremely
    unlikely segfault.
---
 src/keyboard.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/keyboard.c b/src/keyboard.c
index 19c8fdf1dc..69e741070c 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -4633,6 +4633,8 @@ timer_check (void)
 
   Lisp_Object tem = Vinhibit_quit;
   Vinhibit_quit = Qt;
+  block_input ();
+  turn_on_atimers (false);
 
   /* We use copies of the timers' lists to allow a timer to add itself
      again, without locking up Emacs if the newly added timer is
@@ -4646,6 +4648,8 @@ timer_check (void)
   else
     idle_timers = Qnil;
 
+  turn_on_atimers (true);
+  unblock_input ();
   Vinhibit_quit = tem;
 
   do



reply via email to

[Prev in Thread] Current Thread [Next in Thread]