aboutsummaryrefslogtreecommitdiffstats
path: root/src/keyboard.c
diff options
context:
space:
mode:
authorPaul Eggert2015-07-17 11:54:24 -0700
committerPaul Eggert2015-08-05 10:36:46 -0700
commita27ae9d7650a1230d4359eaf0a949f827315a6d2 (patch)
tree22b1733c43693ef2869a1408a7783efc35b6b16e /src/keyboard.c
parenta5e6f33b4c8222ad62fdd7ff4bb0f8c5fac432c1 (diff)
downloademacs-24.tar.gz
emacs-24.zip
Fix hang with large yanksemacs-24
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.
Diffstat (limited to 'src/keyboard.c')
-rw-r--r--src/keyboard.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/keyboard.c b/src/keyboard.c
index 945019e8418..77af44a7d46 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -3663,8 +3663,7 @@ kbd_buffer_store_event_hold (register struct input_event *event,
3663 /* Don't read keyboard input until we have processed kbd_buffer. 3663 /* Don't read keyboard input until we have processed kbd_buffer.
3664 This happens when pasting text longer than KBD_BUFFER_SIZE/2. */ 3664 This happens when pasting text longer than KBD_BUFFER_SIZE/2. */
3665 hold_keyboard_input (); 3665 hold_keyboard_input ();
3666 if (!noninteractive) 3666 unrequest_sigio ();
3667 ignore_sigio ();
3668 stop_polling (); 3667 stop_polling ();
3669 } 3668 }
3670#endif /* subprocesses */ 3669#endif /* subprocesses */
@@ -3829,6 +3828,7 @@ kbd_buffer_get_event (KBOARD **kbp,
3829 /* Start reading input again because we have processed enough to 3828 /* Start reading input again because we have processed enough to
3830 be able to accept new events again. */ 3829 be able to accept new events again. */
3831 unhold_keyboard_input (); 3830 unhold_keyboard_input ();
3831 request_sigio ();
3832 start_polling (); 3832 start_polling ();
3833 } 3833 }
3834#endif /* subprocesses */ 3834#endif /* subprocesses */