summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ractor.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/ractor.h b/ractor.h
index de4d722b5b..640fc62ff5 100644
--- a/ractor.h
+++ b/ractor.h
@@ -254,12 +254,13 @@ rb_ractor_confirm_belonging(VALUE obj)
uint32_t id = rb_ractor_belonging(obj);
if (id == 0) {
- if (!rb_ractor_shareable_p(obj)) {
+ if (UNLIKELY(!rb_ractor_shareable_p(obj))) {
rp(obj);
rb_bug("id == 0 but not shareable");
}
}
- else if (id != rb_ractor_current_id()) {
+ else if (UNLIKELY(id != rb_ractor_current_id())) {
+ rp(obj);
rb_bug("rb_ractor_confirm_belonging object-ractor id:%u, current-ractor id:%u", id, rb_ractor_current_id());
}
return obj;