aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-20 03:50:41 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-20 03:50:41 +0000
commita3419bc919b49d2c4a6efe04b375e7700f43e4b8 (patch)
treebc15eea76254f38c13c4d1af69de112d502989d7 /test
parent1433c13b257fcc5bb03217932b61a638be49d116 (diff)
downloadruby-a3419bc919b49d2c4a6efe04b375e7700f43e4b8.tar.gz
* 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
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_io.rb14
1 files changed, 14 insertions, 0 deletions
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