fix Ractor#receive by other ractors

Ractor#receive can be called by the another Ractors using send,
so making this method completely same as `Ractor.receive` even if
the ractor is specified by the receiver (OO term :p).
This commit is contained in:
Koichi Sasada 2020-12-16 17:18:07 +09:00
parent c668772b14
commit 0a52161872

View File

@ -94,10 +94,10 @@ class Ractor
alias recv receive
end
# same as Ractor.receive
private def receive
__builtin_cexpr! %q{
// TODO: check current actor
ractor_receive(ec, RACTOR_PTR(self))
ractor_receive(ec, rb_ec_ractor_ptr(ec))
}
end
alias recv receive