diff options
author | Eli Zaretskii <eliz@gnu.org> | 2016-12-19 19:11:16 +0200 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2016-12-19 19:11:16 +0200 |
commit | fe3188b1cecc7ac5534616c8edf14a84b1b3bbb0 (patch) | |
tree | 39041b114c679f98255e9c95f2b4666d6f269ab2 /src/syssignal.h | |
parent | 657bcaf5ac30449915e070c3fa80a2eaaf1ee7e1 (diff) | |
download | emacs-fe3188b1cecc7ac5534616c8edf14a84b1b3bbb0.tar.gz |
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)
Diffstat (limited to 'src/syssignal.h')
-rw-r--r-- | src/syssignal.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/syssignal.h b/src/syssignal.h index 3de83c71759..62704fc351e 100644 --- a/src/syssignal.h +++ b/src/syssignal.h @@ -25,6 +25,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ extern void init_signals (bool); extern void block_child_signal (sigset_t *); extern void unblock_child_signal (sigset_t const *); +extern void block_interrupt_signal (sigset_t *); +extern void restore_signal_mask (sigset_t const *); extern void block_tty_out_signal (sigset_t *); extern void unblock_tty_out_signal (sigset_t const *); |