diff options
author | Koichi Sasada <ko1@atdot.net> | 2020-12-21 18:06:28 +0900 |
---|---|---|
committer | Koichi Sasada <ko1@atdot.net> | 2020-12-21 22:29:05 +0900 |
commit | dca6752fecc6733575145185764d7b6a218cee96 (patch) | |
tree | 1628aa1a7d65fba03e6c662c471fdbd06efa0203 /vm_insnhelper.c | |
parent | 8c0c61728fd08bd7c3c29612de8b3486d75339dc (diff) |
Introduce Ractor::IsolationError
Ractor has several restrictions to keep each ractor being isolated
and some operation such as `CONST="foo"` in non-main ractor raises
an exception. This kind of operation raises an error but there is
confusion (some code raises RuntimeError and some code raises
NameError).
To make clear we introduce Ractor::IsolationError which is raised
when the isolation between ractors is violated.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3957
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r-- | vm_insnhelper.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c index 6c7ff594c2..b1673db067 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -1002,7 +1002,7 @@ vm_get_ev_const(rb_execution_context_t *ec, VALUE orig_klass, ID id, bool allow_ else { if (UNLIKELY(!rb_ractor_main_p())) { if (!rb_ractor_shareable_p(val)) { - rb_raise(rb_eNameError, + rb_raise(rb_eRactorIsolationError, "can not access non-shareable objects in constant %"PRIsVALUE"::%s by non-main ractor.", rb_class_path(klass), rb_id2name(id)); } } |