diff options
author | Andrew Whatson <whatson@gmail.com> | 2021-05-08 23:49:08 +1000 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2021-05-08 21:31:37 +0200 |
commit | 5a281e35f4a5ae78fbcf10591d9358bec8f0bee0 (patch) | |
tree | c86d33be9db2445530603af71ca1b88ea59766f1 /libguile/posix.c | |
parent | bef971105d7b319ba3a26fc44f91630b727f9028 (diff) | |
download | guile-5a281e35f4a5ae78fbcf10591d9358bec8f0bee0.tar.gz |
Close the finalization pipe before forking.
Partly fixes <https://bugs.gnu.org/41948>.
Reported by Mathieu Othacehe <othacehe@gnu.org>.
Previously, after 'fork', the child process could end up sharing the
finalization thread with its parent.
* libguile/finalizers.c (finalization_pipe): Initialize.
(reset_finalization_pipe): Factored out.
(start_finalization_thread): Create the pipe immediately before
launching the thread. Ensure the pipe is cleaned up if thread creation
fails. Update the finalizer callback if thread creation succeeds.
(stop_finalization_thread): Clean up the pipe after stopping the thread.
(spawn_finalizer_thread): Remove finalizer callback logic.
(scm_set_automatic_finalization_enabled): Remove pipe management.
(scm_init_finalizer_thread): Remove pipe management.
Co-authored-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'libguile/posix.c')
0 files changed, 0 insertions, 0 deletions