Skip to content

Commit cdeedd5

Browse files
Fix handling of cancelled blocking operations. (ruby#13570)
1 parent 20adae4 commit cdeedd5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

scheduler.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,9 +1061,8 @@ VALUE rb_fiber_scheduler_blocking_operation_wait(VALUE scheduler, void* (*functi
10611061
operation->data2 = NULL;
10621062
operation->unblock_function = NULL;
10631063

1064-
// If the blocking operation was never executed, return Qundef to signal
1065-
// the caller to use rb_nogvl instead
1066-
if (current_status != RB_FIBER_SCHEDULER_BLOCKING_OPERATION_STATUS_COMPLETED) {
1064+
// If the blocking operation was never executed, return Qundef to signal the caller to use rb_nogvl instead
1065+
if (current_status == RB_FIBER_SCHEDULER_BLOCKING_OPERATION_STATUS_QUEUED) {
10671066
return Qundef;
10681067
}
10691068

0 commit comments

Comments
 (0)