From 310c00a1371ccbf584b7aaa4c1768a68c3813f58 Mon Sep 17 00:00:00 2001 From: John Hawthorn Date: Tue, 25 Mar 2025 14:34:41 -0700 Subject: [PATCH] Reset thread interrupt lock on fork If a thread was holding this lock before fork, it will not exist in the child process. We should re-initialize these locks as we do with the VM locks when forking. Co-authored-by: Aaron Patterson --- thread.c | 1 + 1 file changed, 1 insertion(+) diff --git a/thread.c b/thread.c index 359671ba9e..2efb237f58 100644 --- a/thread.c +++ b/thread.c @@ -4756,6 +4756,7 @@ static void terminate_atfork_i(rb_thread_t *th, const rb_thread_t *current_th) { if (th != current_th) { + rb_native_mutex_initialize(&th->interrupt_lock); rb_mutex_abandon_keeping_mutexes(th); rb_mutex_abandon_locking_mutex(th); thread_cleanup_func(th, TRUE);