diff options
author | Koichi Sasada <ko1@atdot.net> | 2020-12-22 02:22:51 +0900 |
---|---|---|
committer | Koichi Sasada <ko1@atdot.net> | 2020-12-22 05:54:14 +0900 |
commit | d0e4ccbefcdd6032d0ae70bc54c9a4fb55d92576 (patch) | |
tree | e3f9a1c74ab923e831e8049352d984d0ceb4719a /ractor.rb | |
parent | 35471a948739ca13b85fe900871e081d553f68e6 (diff) |
add Ractor.main
It returns main Ractor, like Thread.main.
[Feature #17418]
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3963
Diffstat (limited to 'ractor.rb')
-rw-r--r-- | ractor.rb | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -768,4 +768,11 @@ class Ractor def []=(sym, val) Primitive.ractor_local_value_set(sym, val) end + + # returns main ractor + def self.main + __builtin_cexpr! %q{ + rb_ractor_self(GET_VM()->ractor.main_ractor); + } + end end |