Skip to content

Commit 8b6b7cd

Browse files
committed
Add RUBY_VM_CHECK_INTS_BLOCKING before EC_POP_TAG in every case.
1 parent bc3eca7 commit 8b6b7cd

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

test/fiber/test_io_close.rb

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,10 @@
33
require_relative 'scheduler'
44

55
class TestFiberIOClose < Test::Unit::TestCase
6-
def with_socket_pair
6+
def with_socket_pair(&block)
77
omit unless defined?(UNIXSocket)
88

9-
UNIXSocket.pair do |i, o|
10-
if RUBY_PLATFORM =~ /mswin|mingw/
11-
i.nonblock = true
12-
o.nonblock = true
13-
end
14-
15-
yield i, o
16-
end
9+
UNIXSocket.pair(&block)
1710
end
1811

1912
def test_io_close_across_fibers

thread.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1947,8 +1947,6 @@ rb_thread_io_blocking_call(struct rb_io* io, rb_blocking_function_t *func, void
19471947
EC_JUMP_TAG(ec, state);
19481948
}
19491949

1950-
RUBY_VM_CHECK_INTS_BLOCKING(ec);
1951-
19521950
// If the error was a timeout, we raise a specific exception for that:
19531951
if (saved_errno == ETIMEDOUT) {
19541952
rb_raise(rb_eIOTimeoutError, "Blocking operation timed out!");
@@ -4568,7 +4566,10 @@ thread_io_wait(struct rb_io *io, int fd, int events, struct timeval *timeout)
45684566

45694567
RUBY_VM_CHECK_INTS_BLOCKING(ec);
45704568
} while (wait_retryable(&result, lerrno, to, end));
4569+
4570+
RUBY_VM_CHECK_INTS_BLOCKING(ec);
45714571
}
4572+
45724573
EC_POP_TAG();
45734574
}
45744575

0 commit comments

Comments
 (0)