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 fbc9192af8..382d3d5199 100644
--- a/ractor.c
+++ b/ractor.c
@@ -832,6 +832,10 @@ ractor_try_yield(rb_execution_context_t *ec, rb_ractor_t *cr, struct rb_ractor_b
ASSERT_ractor_unlocking(cr);
VM_ASSERT(basket->type != basket_type_none);
+ if (cr->outgoing_port_closed) {
+ rb_raise(rb_eRactorClosedError, "The outgoing-port is already closed");
+ }
+
rb_ractor_t *r;
retry_shift:
@@ -1017,6 +1021,10 @@ ractor_select(rb_execution_context_t *ec, const VALUE *rs, int alen, VALUE yield
cr->wait.wakeup_status = wakeup_by_retry;
goto skip_sleep;
}
+ else if (cr->outgoing_port_closed) {
+ cr->wait.wakeup_status = wakeup_by_close;
+ goto skip_sleep;
+ }
break;
}
}