From 17e4aff277a350fa6afea31bc521c9a3f4f47353 Mon Sep 17 00:00:00 2001 From: normal Date: Mon, 20 Aug 2018 21:34:39 +0000 Subject: thread_pthread.c: reinitialize ubf_list at fork It's possible for the ubf_list_head to be populated with dead threads at fork or the ubf_list_lock to be held, so reinitialize both at startup. And while we're at it, use a static initializer at startup to save a library call and kill some ifdef. [ruby-core:88578] [Bug #15013] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64485 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- thread.c | 1 + 1 file changed, 1 insertion(+) (limited to 'thread.c') diff --git a/thread.c b/thread.c index c756b53bea..51710d24a7 100644 --- a/thread.c +++ b/thread.c @@ -4396,6 +4396,7 @@ rb_thread_atfork_internal(rb_thread_t *th, void (*atfork)(rb_thread_t *, const r vm->main_thread = th; gvl_atfork(th->vm); + ubf_list_atfork(); list_for_each(&vm->living_threads, i, vmlt_node) { atfork(i, th); -- cgit v1.2.3