diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-31 15:31:46 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-31 15:31:46 +0000 |
commit | 6f6dd30dbf3a1e77c643bb7e1391ed28e59f4dc7 (patch) | |
tree | 6af3ed96b10a908289a8c5ce4f5f14fa7fd89a89 /test/ruby | |
parent | 06fb82343528ea1e479d10d97946862d8a3dff61 (diff) | |
download | ruby-6f6dd30dbf3a1e77c643bb7e1391ed28e59f4dc7.tar.gz |
Join threads.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46286 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_file.rb | 3 | ||||
-rw-r--r-- | test/ruby/test_process.rb | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/test/ruby/test_file.rb b/test/ruby/test_file.rb index 9462ae597b..974752c853 100644 --- a/test/ruby/test_file.rb +++ b/test/ruby/test_file.rb @@ -124,7 +124,7 @@ class TestFile < Test::Unit::TestCase q1 = Queue.new q2 = Queue.new - Thread.new do + th = Thread.new do data = '' 64.times do |i| data << i.to_s @@ -142,6 +142,7 @@ class TestFile < Test::Unit::TestCase assert_equal size, f.size q2.push true end + th.join end end diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb index 75657ab894..ccd5676171 100644 --- a/test/ruby/test_process.rb +++ b/test/ruby/test_process.rb @@ -1237,8 +1237,9 @@ class TestProcess < Test::Unit::TestCase IO.pipe do |r, w| pid = spawn(RUBY, "foo", out: w) w.close - Thread.new { r.read(1); Process.kill(:SIGQUIT, pid) } + th = Thread.new { r.read(1); Process.kill(:SIGQUIT, pid) } Process.wait(pid) + th.join end t = Time.now s = $? |