From cdeedd5bc1a3c712f7f7b8c2409906a0b5ed9e37 Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Tue, 10 Jun 2025 16:30:43 +0900 Subject: [PATCH] Fix handling of cancelled blocking operations. (#13570) --- scheduler.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scheduler.c b/scheduler.c index 80c0278933..11faca01d3 100644 --- a/scheduler.c +++ b/scheduler.c @@ -1061,9 +1061,8 @@ VALUE rb_fiber_scheduler_blocking_operation_wait(VALUE scheduler, void* (*functi operation->data2 = NULL; operation->unblock_function = NULL; - // If the blocking operation was never executed, return Qundef to signal - // the caller to use rb_nogvl instead - if (current_status != RB_FIBER_SCHEDULER_BLOCKING_OPERATION_STATUS_COMPLETED) { + // If the blocking operation was never executed, return Qundef to signal the caller to use rb_nogvl instead + if (current_status == RB_FIBER_SCHEDULER_BLOCKING_OPERATION_STATUS_QUEUED) { return Qundef; }