From a2d63ea2fb84c962abddae877e9493fc57cfce1a Mon Sep 17 00:00:00 2001 From: normal Date: Tue, 27 Mar 2018 09:28:37 +0000 Subject: thread_sync.c: avoid reaching across stacks of dead threads rb_ensure is insufficient cleanup for fork and we must reinitialize all waitqueues in the child process. Unfortunately this increases the footprint of ConditionVariable, Queue and SizedQueue by 8 bytes on 32-bit (16 bytes on 64-bit). [ruby-core:86316] [Bug #14634] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- thread.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'thread.c') diff --git a/thread.c b/thread.c index ea0f526d2e..1caea4976c 100644 --- a/thread.c +++ b/thread.c @@ -4216,6 +4216,8 @@ rb_thread_atfork_internal(rb_thread_t *th, void (*atfork)(rb_thread_t *, const r } rb_vm_living_threads_init(vm); rb_vm_living_threads_insert(vm, th); + rb_thread_sync_reset_all(); + vm->sleeper = 0; clear_coverage(); } -- cgit v1.2.3