diff options
| author | John Hawthorn <john@hawthorn.email> | 2025-03-25 14:34:41 -0700 |
|---|---|---|
| committer | John Hawthorn <john@hawthorn.email> | 2025-03-25 19:14:26 -0700 |
| commit | 310c00a1371ccbf584b7aaa4c1768a68c3813f58 (patch) | |
| tree | eb78aec009ad026b77a118320a51b3650c5203ba /thread.c | |
| parent | be6954f5d466f4b274505e4f14bcad291d0b0989 (diff) | |
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 <tenderlove@ruby-lang.org>
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/12981
Diffstat (limited to 'thread.c')
| -rw-r--r-- | thread.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -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); |
