aboutsummaryrefslogtreecommitdiffstats
path: root/thread.c
diff options
context:
space:
mode:
authorSamuel Williams <samuel.williams@oriontransfer.co.nz>2022-12-01 23:00:33 +1300
committerGitHub <noreply@github.com>2022-12-01 23:00:33 +1300
commit0436f1e15a8e79ffef5ea412ac1312cbf9f063e6 (patch)
tree456611e5ae13d2c1312a61532ab7a79d642564b6 /thread.c
parent9869bd1d612b489df806cf95bcb56965a02424e0 (diff)
downloadruby-0436f1e15a8e79ffef5ea412ac1312cbf9f063e6.tar.gz
Introduce `Fiber#storage` for inheritable fiber-scoped variables. (#6612)
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/thread.c b/thread.c
index 1b12ec2077..56a5644552 100644
--- a/thread.c
+++ b/thread.c
@@ -813,6 +813,8 @@ thread_create_core(VALUE thval, struct thread_create_params *params)
"can't start a new thread (frozen ThreadGroup)");
}
+ rb_fiber_inherit_storage(ec, th->ec->fiber_ptr);
+
switch (params->type) {
case thread_invoke_type_proc:
th->invoke_type = thread_invoke_type_proc;