diff options
author | Philipp Stephani <phst@google.com> | 2021-01-10 16:31:12 +0100 |
---|---|---|
committer | Philipp Stephani <phst@google.com> | 2021-01-16 19:46:44 +0100 |
commit | 8f0ce42d3eb9b212424a4a25a376287ffc94a73e (patch) | |
tree | b05a83f36c0617184079a9fa5ce33a945e7e736e /test/lisp/emacs-lisp/pcase-tests.el | |
parent | 66756df286bea6efd3f9a8290e38e8d77bdf0264 (diff) | |
download | emacs-8f0ce42d3eb9b212424a4a25a376287ffc94a73e.tar.gz emacs-8f0ce42d3eb9b212424a4a25a376287ffc94a73e.tar.bz2 emacs-8f0ce42d3eb9b212424a4a25a376287ffc94a73e.zip |
Fix deadlock when receiving SIGCHLD during 'pselect'.
If we receive and handle a SIGCHLD signal for a process while waiting
for that process, 'pselect' might never return. Instead, we have to
explicitly 'pselect' that the process status has changed. We do this
by writing to a pipe in the SIGCHLD handler and having
'wait_reading_process_output' select on it.
* src/process.c (child_signal_init): New helper function to create a
pipe for SIGCHLD notifications.
(child_signal_read, child_signal_notify): New helper functions to
read from/write to the child signal pipe.
(create_process): Initialize the child signal pipe on first use.
(handle_child_signal): Notify waiters that a process status has
changed.
(wait_reading_process_output): Make sure that we also catch
SIGCHLD/process status changes.
* test/src/process-tests.el
(process-tests/fd-setsize-no-crash/make-process): Remove workaround,
which is no longer needed.
Diffstat (limited to 'test/lisp/emacs-lisp/pcase-tests.el')
0 files changed, 0 insertions, 0 deletions