From dffe87c72014a4732282126acc87c898fddb0d81 Mon Sep 17 00:00:00 2001 From: usa Date: Fri, 3 Jul 2015 08:51:59 +0000 Subject: merge revision(s) 50887,50896,50902: [Backport #11060] * file.c (rb_file_load_ok): try opening file without gvl not to lock entire process. [Bug #11060] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@51118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_require.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_require.rb b/test/ruby/test_require.rb index 2bdad8f981..44bcfc6343 100644 --- a/test/ruby/test_require.rb +++ b/test/ruby/test_require.rb @@ -687,4 +687,17 @@ class TestRequire < Test::Unit::TestCase INPUT } end + + def test_loading_fifo_threading + Tempfile.create(%w'fifo .rb') {|f| + f.close + File.unlink(f.path) + File.mkfifo(f.path) + assert_separately(["-", f.path], <<-END, timeout: 3) + th = Thread.current + Thread.start {begin sleep(0.001) end until th.stop?; th.raise(IOError)} + assert_raise(IOError) {load(ARGV[0])} + END + } + end unless /mswin|mingw/ =~ RUBY_PLATFORM end -- cgit v1.2.3