]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix hang with large yanks emacs-24
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 17 Jul 2015 18:54:24 +0000 (11:54 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 5 Aug 2015 17:36:46 +0000 (10:36 -0700)
Backport of master commit 0592cefd03f1de2f04b721d07a16e6e0a9e48f73.
This should fix the bug fixed by Mike 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 239c44256469bd7718f84e65b4bf9914af9151fc..cf3d1ecaf9cd484ad404f6e722ab7cade4123dfa 100644 (file)
@@ -3349,7 +3349,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 9b78a70428e866405fc61ece4ad4f8252e85ad97..b5d3ab46a00796baeb20d7a79d0be499d3bc52c0 100644 (file)
@@ -2028,7 +2028,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 945019e84185d2f2ade684d4b3e103c2edd918ff..77af44a7d468a3e42765e1e9cd52616914f87d9b 100644 (file)
@@ -3663,8 +3663,7 @@ kbd_buffer_store_event_hold (register struct 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 */
@@ -3829,6 +3828,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 01692c2d214b650c2dfeda784f1cea43df5cfeb2..4b4801d58c9387ab649a1c9bef259fe72d46b43e 100644 (file)
@@ -649,15 +649,6 @@ unrequest_sigio (void)
   interrupts_deferred = 1;
 #endif
 }
-
-void
-ignore_sigio (void)
-{
-#ifdef USABLE_SIGIO
-  signal (SIGIO, SIG_IGN);
-#endif
-}
-
 \f
 /* Saving and restoring the process group of Emacs's terminal.  */