aboutsummaryrefslogtreecommitdiffstats
path: root/vm_core.h
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2020-10-30 00:32:53 +0900
committerKoichi Sasada <ko1@atdot.net>2020-10-30 03:12:09 +0900
commit5d97bdc2dcb835c877010daa033cc2b1dfeb86d6 (patch)
tree147bbd2e687a9db2bbd5fede670690eae644ebe1 /vm_core.h
parent502d6d845946f367ffb6e972e9c4ac401da94e99 (diff)
downloadruby-5d97bdc2dcb835c877010daa033cc2b1dfeb86d6.tar.gz
Ractor.make_shareable(a_proc)
Ractor.make_shareable() supports Proc object if (1) a Proc only read outer local variables (no assignments) (2) read outer local variables are shareable. Read local variables are stored in a snapshot, so after making shareable Proc, any assignments are not affeect like that: ```ruby a = 1 pr = Ractor.make_shareable(Proc.new{p a}) pr.call #=> 1 a = 2 pr.call #=> 1 # `a = 2` doesn't affect ``` [Feature #17284]
Diffstat (limited to 'vm_core.h')
-rw-r--r--vm_core.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/vm_core.h b/vm_core.h
index c4341b474c..9ef3af515c 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -1065,6 +1065,7 @@ typedef struct {
VALUE rb_proc_isolate(VALUE self);
VALUE rb_proc_isolate_bang(VALUE self);
+VALUE rb_proc_ractor_make_shareable(VALUE self);
typedef struct {
VALUE flags; /* imemo header */