summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2020-12-21 18:06:28 +0900
committerKoichi Sasada <ko1@atdot.net>2020-12-21 22:29:05 +0900
commitdca6752fecc6733575145185764d7b6a218cee96 (patch)
tree1628aa1a7d65fba03e6c662c471fdbd06efa0203 /vm.c
parent8c0c61728fd08bd7c3c29612de8b3486d75339dc (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.c')
-rw-r--r--vm.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/vm.c b/vm.c
index ee28a2d..9ed358f 100644
--- a/vm.c
+++ b/vm.c
@@ -994,7 +994,6 @@ collect_outer_variable_names(ID id, VALUE val, void *ptr)
return ID_TABLE_CONTINUE;
}
-VALUE rb_ractor_error_class(void);
VALUE rb_ractor_make_shareable(VALUE obj);
static const rb_env_t *
@@ -1015,7 +1014,7 @@ env_copy(const VALUE *src_ep, VALUE read_only_variables)
if (id == src_env->iseq->body->local_table[j]) {
VALUE v = src_env->env[j];
if (!rb_ractor_shareable_p(v)) {
- rb_raise(rb_ractor_error_class(),
+ rb_raise(rb_eRactorIsolationError,
"can not make shareable Proc because it can refer unshareable object %"
PRIsVALUE" from variable `%s'", rb_inspect(v), rb_id2name(id));
}