From a3419bc919b49d2c4a6efe04b375e7700f43e4b8 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 20 Jul 2010 03:50:41 +0000 Subject: * io.c (io_flush_buffer): write and buffer operations should be monolithic. [ruby-core:31348] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_io.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test/ruby/test_io.rb') diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb index 41d3640105..bd4326060c 100644 --- a/test/ruby/test_io.rb +++ b/test/ruby/test_io.rb @@ -1609,4 +1609,18 @@ End t.close assert_raise(IOError) {t.binmode} end + + def test_threaded_flush + bug3585 = '[ruby-core:31348]' + src = %q{\ + t = Thread.new { sleep 3 } + Thread.new {sleep 1; t.kill; p 'hi!'} + t.join + }.gsub(/^\s+/, '') + 10.times.map do + Thread.start do + assert_in_out_err([], src, [%q["hi!"]]) + end + end.each {|th| th.join} + end end -- cgit v1.2.3