[前][次][番号順一覧][スレッド一覧]

ruby-changes:53723

From: normal <ko1@a...>
Date: Sat, 24 Nov 2018 06:39:25 +0900 (JST)
Subject: [ruby-changes:53723] normal:r65939 (trunk): io.c (io_fd_check_closed): prioritize cross-thread "stream closed"

normal	2018-11-24 06:38:41 +0900 (Sat, 24 Nov 2018)

  New Revision: 65939

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=65939

  Log:
    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

  Modified files:
    trunk/io.c
Index: io.c
===================================================================
--- io.c	(revision 65938)
+++ io.c	(revision 65939)
@@ -638,7 +638,8 @@ static void https://github.com/ruby/ruby/blob/trunk/io.c#L638
 io_fd_check_closed(int fd)
 {
     if (fd < 0) {
-	rb_raise(rb_eIOError, closed_stream);
+        rb_thread_check_ints(); /* check for ruby_error_stream_closed */
+        rb_raise(rb_eIOError, closed_stream);
     }
 }
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]