]> code.delx.au - gnu-emacs/commitdiff
Fix hang with large yanks This should fix the bug fixed by Mike
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 17 Jul 2015 18:54:24 +0000 (11:54 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 17 Jul 2015 18:55:02 +0000 (11:55 -0700)
Crowe's patch in:
https://lists.gnu.org/archive/html/emacs-devel/2015-07/msg00106.html
A problem in this area has been reported by several users; see
Bug#16737, Bug#17101, Bug#17026, Bug#17172, Bug#19320, Bug#20283.
This fix differs from Mike Crowe's patch in that it should avoid a
race condition that could lose SIGIO signals.  ignore_sigio dates
back to the 1980s when some platforms couldn't block signals, and
could only ignore them, which led to races when signals arrived
while being ignored.  We shouldn't have to worry about those old
platforms now.
* src/dispextern.h, src/sysdep.c (ignore_sigio): Remove.
* src/emacs.c (shut_down_emacs):
Don't call ignore_sigio; unrequest_sigio should suffice.
* src/keyboard.c (kbd_buffer_store_buffered_event):
Use unrequest_sigio, not ignore_sigio.
(kbd_buffer_get_event):
Call request_sigio when getting the ball rolling again.

src/dispextern.h
src/emacs.c
src/keyboard.c
src/sysdep.c

index 5202142313a2213e69a83e8a5460f6ad26753fc3..37ebab04ddf465a072fed9167441366424b8313a 100644 (file)
@@ -3373,7 +3373,6 @@ void unrequest_sigio (void);
 bool tabs_safe_p (int);
 void init_baud_rate (int);
 void init_sigio (int);
-void ignore_sigio (void);
 
 /* Defined in xfaces.c.  */
 
index aad930633d892eca994bf88374530fde9fa85f6a..93fb5870247ac1c4d297731a018e878150d4b4ad 100644 (file)
@@ -2011,7 +2011,6 @@ shut_down_emacs (int sig, Lisp_Object stuff)
   /* There is a tendency for a SIGIO signal to arrive within exit,
      and cause a SIGHUP because the input descriptor is already closed.  */
   unrequest_sigio ();
-  ignore_sigio ();
 
   /* Do this only if terminating normally, we want glyph matrices
      etc. in a core dump.  */
index c5a392f862dc2174975a18d16566f1744763a26f..6bd123c67109358d669f70a814a0a2894ef31e1d 100644 (file)
@@ -3649,8 +3649,7 @@ kbd_buffer_store_buffered_event (union buffered_input_event *event,
           /* Don't read keyboard input until we have processed kbd_buffer.
              This happens when pasting text longer than KBD_BUFFER_SIZE/2.  */
           hold_keyboard_input ();
-          if (!noninteractive)
-            ignore_sigio ();
+          unrequest_sigio ();
           stop_polling ();
         }
 #endif /* subprocesses */
@@ -3849,6 +3848,7 @@ kbd_buffer_get_event (KBOARD **kbp,
       /* Start reading input again because we have processed enough to
          be able to accept new events again.  */
       unhold_keyboard_input ();
+      request_sigio ();
       start_polling ();
     }
 #endif /* subprocesses */
index 30a55f11409509e04467f420a3e67825c11fb5ad..df3e573a6ea740a005b6d6c1e752b2bf93a1a0af 100644 (file)
@@ -659,14 +659,6 @@ unrequest_sigio (void)
   interrupts_deferred = 1;
 #endif
 }
-
-void
-ignore_sigio (void)
-{
-#ifdef USABLE_SIGIO
-  signal (SIGIO, SIG_IGN);
-#endif
-}
 \f
 #ifndef MSDOS
 /* Block SIGCHLD.  */