summaryrefslogtreecommitdiff
path: root/ractor.c
diff options
context:
space:
mode:
Diffstat (limited to 'ractor.c')
-rw-r--r--ractor.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/ractor.c b/ractor.c
index f010574028..0c17d575ee 100644
--- a/ractor.c
+++ b/ractor.c
@@ -2531,6 +2531,14 @@ rb_ractor_ensure_shareable(VALUE obj, VALUE name)
return obj;
}
+void
+rb_ractor_ensure_main_ractor(const char *msg)
+{
+ if (!rb_ractor_main_p()) {
+ rb_raise(rb_eRactorIsolationError, "%s", msg);
+ }
+}
+
static enum obj_traverse_iterator_result
shareable_p_enter(VALUE obj)
{