Introduce Fiber#storage for inheritable fiber-scoped variables. (#6612)

This commit is contained in:
Samuel Williams 2022-12-01 23:00:33 +13:00 committed by GitHub
parent 9869bd1d61
commit 0436f1e15a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
Notes: git 2022-12-01 10:00:52 +00:00
Merged-By: ioquatix <samuel@codeotaku.com>
10 changed files with 442 additions and 56 deletions

View file

@ -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;