Acquire VM lock around fork
Otherwise it might be held by another Ractor, causing a deadlock in the new process.
This commit is contained in:
parent
c750856367
commit
d7ad53f249
Notes:
git
2025-05-08 17:53:42 +00:00
@ -4132,8 +4132,12 @@ rb_fork_ruby(int *status)
|
|||||||
rb_thread_acquire_fork_lock();
|
rb_thread_acquire_fork_lock();
|
||||||
disable_child_handler_before_fork(&old);
|
disable_child_handler_before_fork(&old);
|
||||||
|
|
||||||
|
RB_VM_LOCK_ENTER();
|
||||||
|
{
|
||||||
child.pid = pid = rb_fork();
|
child.pid = pid = rb_fork();
|
||||||
child.error = err = errno;
|
child.error = err = errno;
|
||||||
|
}
|
||||||
|
RB_VM_LOCK_LEAVE();
|
||||||
|
|
||||||
disable_child_handler_fork_parent(&old); /* yes, bad name */
|
disable_child_handler_fork_parent(&old); /* yes, bad name */
|
||||||
if (
|
if (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user