1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

io.c (io_fd_check_closed): prioritize cross-thread "stream closed"

This may fix failures from TestIO#test_recycled_fd_close because
interrupts may be missed due to TOCTOU in other places.

cf. http://ci.rvm.jp/results/trunk-nopara@silicon-docker/1475034

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
normal 2018-11-23 21:38:41 +00:00
parent 34f0e8edfd
commit a6a7d988b4

1
io.c
View file

@ -638,6 +638,7 @@ static void
io_fd_check_closed(int fd) io_fd_check_closed(int fd)
{ {
if (fd < 0) { if (fd < 0) {
rb_thread_check_ints(); /* check for ruby_error_stream_closed */
rb_raise(rb_eIOError, closed_stream); rb_raise(rb_eIOError, closed_stream);
} }
} }