diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2022-09-11 08:59:27 +0900 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2022-09-11 09:09:05 +0900 |
commit | aa8a3b2358fbdc176c6bcfbcfd3ed1646d287d62 (patch) | |
tree | 7ad63e54e2ebddb771fa289018b6a33ab68e5faa /process.c | |
parent | c22a668580fc9a0c211d55c350a395f830a0740e (diff) | |
download | ruby-aa8a3b2358fbdc176c6bcfbcfd3ed1646d287d62.tar.gz |
MJIT: Do not hang after forking with threads
First, rb_mjit_fork should call rb_thread_atfork to stop threads after
fork in the child process. Unfortunately, we cannot use rb_fork_ruby to
prevent this kind of mistakes because MJIT needs special handling of
waiting_pid and mjit_pause/resume.
Second, mjit_waitpid_finished should be checked regardless of
trap_interrupt. It doesn't seem like the flag is not set when SIGCHLD is
handled for an MJIT child process.
Diffstat (limited to 'process.c')
-rw-r--r-- | process.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -4222,6 +4222,7 @@ rb_mjit_fork(void) after_fork_ruby(); disable_child_handler_fork_parent(&old); + if (pid == 0) rb_thread_atfork(); return pid; } |