From 8eea9a502031e866f210accc7d02347fc55f65c9 Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Mon, 1 Dec 2025 17:19:42 +1300 Subject: Nullify scheduler during `terminate_atfork_i`. (#15354) --- thread.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'thread.c') diff --git a/thread.c b/thread.c index f545a5377d..6e5c8e89ff 100644 --- a/thread.c +++ b/thread.c @@ -4979,6 +4979,9 @@ static void terminate_atfork_i(rb_thread_t *th, const rb_thread_t *current_th) { if (th != current_th) { + // Clear the scheduler as it is no longer operational: + th->scheduler = Qnil; + rb_native_mutex_initialize(&th->interrupt_lock); rb_mutex_abandon_keeping_mutexes(th); rb_mutex_abandon_locking_mutex(th); -- cgit v1.2.3