summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-20 21:34:39 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-20 21:34:39 +0000
commit17e4aff277a350fa6afea31bc521c9a3f4f47353 (patch)
tree90ba3ef3466488f774f2d9dd3a6277b2e0ab3816 /thread.c
parentce48b55805873ad3913be832e919e3ebe8b8f7a3 (diff)
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
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/thread.c b/thread.c
index c756b53..51710d2 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);