summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authorSamuel Williams <samuel.williams@shopify.com>2025-12-01 17:19:42 +1300
committerGitHub <noreply@github.com>2025-12-01 17:19:42 +1300
commit8eea9a502031e866f210accc7d02347fc55f65c9 (patch)
tree3d919ea782a16c888a9ccfca62dca3d537d12150 /thread.c
parent4c56001d27c4b2431fee65e6e9426319c475c45d (diff)
Nullify scheduler during `terminate_atfork_i`. (#15354)
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c3
1 files changed, 3 insertions, 0 deletions
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);