]> git.eshelyaron.com Git - emacs.git/commit
Fix crashes upon C-g on Posix TTY frames
authorEli Zaretskii <eliz@gnu.org>
Mon, 19 Dec 2016 17:11:16 +0000 (19:11 +0200)
committerEli Zaretskii <eliz@gnu.org>
Mon, 19 Dec 2016 17:11:16 +0000 (19:11 +0200)
commitfe3188b1cecc7ac5534616c8edf14a84b1b3bbb0
tree39041b114c679f98255e9c95f2b4666d6f269ab2
parent657bcaf5ac30449915e070c3fa80a2eaaf1ee7e1
Fix crashes upon C-g on Posix TTY frames

* src/thread.h (struct thread_state): New member not_holding_lock.
(maybe_reacquire_global_lock): Add prototype.
* src/thread.c: Include syssignal.h.
(maybe_reacquire_global_lock): New function.
(really_call_select): Set the not_holding_lock member of the
thread state before releasing the lock, and rest it after
re-acquiring the lock when the select function returns.  Block
SIGINT while doing this to make sure we are not interrupted on TTY
frames.
* src/sysdep.c (block_interrupt_signal, restore_signal_mask): New
functions.
* src/syssignal.h (block_interrupt_signal, restore_signal_mask):
Add prototypes.
* src/keyboard.c (read_char) [THREADS_ENABLED]: Call
maybe_reacquire_global_lock.  (Bug#25178)
src/keyboard.c
src/sysdep.c
src/syssignal.h
src/thread.c
src/thread.h