summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authorSharon Rosner <sharon@noteflakes.com>2025-12-05 06:20:39 +0100
committerGitHub <noreply@github.com>2025-12-05 18:20:39 +1300
commit5f6b31c23ff1eefdf3cd5807ce5f80abf24eb1b2 (patch)
tree9736faf696a6d55ce8803cc5e5d14dea6c4d98cf /thread.c
parente822209d3e3dfde39a7d6818951869606ae8cbf0 (diff)
Correctly handle `Process.fork` with an active `Fiber.scheduler`. (#15385)
In the child process, nullify the current fiber scheduler and set the current fiber to blocking.
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/thread.c b/thread.c
index 6e5c8e89ff..5f592a4256 100644
--- a/thread.c
+++ b/thread.c
@@ -4997,6 +4997,7 @@ rb_thread_atfork(void)
rb_threadptr_pending_interrupt_clear(th);
rb_thread_atfork_internal(th, terminate_atfork_i);
th->join_list = NULL;
+ th->scheduler = Qnil;
rb_fiber_atfork(th);
/* We don't want reproduce CVE-2003-0900. */