diff options
author | Koichi Sasada <ko1@atdot.net> | 2020-10-31 00:40:04 +0900 |
---|---|---|
committer | Koichi Sasada <ko1@atdot.net> | 2020-10-31 01:48:00 +0900 |
commit | fd089276999393a6f6bb2a0b614ac76ca6151ab2 (patch) | |
tree | 711b652e7051adc7ab23e150ce65cb0d8f4e2439 /ractor.h | |
parent | 66bf743b9309b479b6d5389e315ca54ea73aafae (diff) | |
download | ruby-fd089276999393a6f6bb2a0b614ac76ca6151ab2.tar.gz |
Ractor's "will" doesn't need copying.
`r = Ractor.new{ expr }` generates the block return value from `expr`
and we can get this value by `r.take`. Ractor.yield and Ractor#take
passing values by copying on default. However, the block return value
(we named it "will" in the code) is not referred from the Ractor
because the Ractor is already dead. So we can pass the reference
of "will" to another ractor without copying. We can apply same story
for the propagated exception.
Diffstat (limited to 'ractor.h')
-rw-r--r-- | ractor.h | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -10,15 +10,15 @@ enum rb_ractor_basket_type { basket_type_none, - basket_type_shareable, - basket_type_copy_marshal, - basket_type_copy_custom, + basket_type_ref, + basket_type_copy, basket_type_move, - basket_type_exception, + basket_type_will, }; struct rb_ractor_basket { enum rb_ractor_basket_type type; + bool exception; VALUE v; VALUE sender; }; |