summaryrefslogtreecommitdiff
path: root/ractor.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ractor.rb')
-rw-r--r--ractor.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/ractor.rb b/ractor.rb
index c73c574bdc..d72e02b60d 100644
--- a/ractor.rb
+++ b/ractor.rb
@@ -758,4 +758,14 @@ class Ractor
}
end
end
+
+ # get a value from ractor-local storage
+ def [](sym)
+ Primitive.ractor_local_value(sym)
+ end
+
+ # set a value in ractor-local storage
+ def []=(sym, val)
+ Primitive.ractor_local_value_set(sym, val)
+ end
end