diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-07-24 10:38:33 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-07-24 10:38:33 +0000 |
commit | 0956a6f4da036d9c3eed1a23b78099d3cf0078c7 (patch) | |
tree | 9dd4a7e54e07add8adec42fb844436332b397dc7 /test | |
parent | d1a5bcd83f408abc13e32047f2f19f758e9b8bbb (diff) |
merges r28687 from trunk into ruby_1_9_2.
--
* 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/branches/ruby_1_9_2@28744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_io.rb | 14 |
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 |