diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-25 05:22:49 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-25 05:22:49 +0000 |
commit | 504453d929da696aa61cdd78397221e0246d9cbc (patch) | |
tree | c8bc8c5a8d7571980f766e330c2530a185a33588 /test/openssl/test_pair.rb | |
parent | bafe3bf3da226f694054aa91ad38266537d0c8bb (diff) |
* test/openssl: Join threads.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/openssl/test_pair.rb')
-rw-r--r-- | test/openssl/test_pair.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/test/openssl/test_pair.rb b/test/openssl/test_pair.rb index f627066d76..c7cfd69129 100644 --- a/test/openssl/test_pair.rb +++ b/test/openssl/test_pair.rb @@ -83,16 +83,20 @@ end module OpenSSL::TestEOF1M def open_file(content) s1, s2 = ssl_pair - Thread.new { s2 << content; s2.close } + th = Thread.new { s2 << content; s2.close } yield s1 + ensure + th.join end end module OpenSSL::TestEOF2M def open_file(content) s1, s2 = ssl_pair - Thread.new { s1 << content; s1.close } + th = Thread.new { s1 << content; s1.close } yield s2 + ensure + th.join end end @@ -317,6 +321,7 @@ module OpenSSL::TestPairM s1.print "a\ndef" assert_equal("a\n", s2.gets) ensure + th.join s1.close if s1 && !s1.closed? s2.close if s2 && !s2.closed? sock1.close if sock1 && !sock1.closed? |