[前][次][番号順一覧][スレッド一覧]

ruby-changes:39365

From: nobu <ko1@a...>
Date: Thu, 30 Jul 2015 13:43:31 +0900 (JST)
Subject: [ruby-changes:39365] nobu:r51446 (trunk): test_pair.rb: join client thread

nobu	2015-07-30 13:43:23 +0900 (Thu, 30 Jul 2015)

  New Revision: 51446

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=51446

  Log:
    test_pair.rb: join client thread
    
    * test/openssl/test_pair.rb (test_ecdh_callback): join client
      thread only when it started.

  Modified files:
    trunk/test/openssl/test_pair.rb
Index: test/openssl/test_pair.rb
===================================================================
--- test/openssl/test_pair.rb	(revision 51445)
+++ test/openssl/test_pair.rb	(revision 51446)
@@ -86,7 +86,7 @@ module OpenSSL::TestEOF1M https://github.com/ruby/ruby/blob/trunk/test/openssl/test_pair.rb#L86
     th = Thread.new { s2 << content; s2.close }
     yield s1
   ensure
-    th.join
+    th.join if th
     s1.close
   end
 end
@@ -97,7 +97,7 @@ module OpenSSL::TestEOF2M https://github.com/ruby/ruby/blob/trunk/test/openssl/test_pair.rb#L97
     th = Thread.new { s1 << content; s1.close }
     yield s2
   ensure
-    th.join
+    th.join if th
     s2.close
   end
 end
@@ -301,7 +301,7 @@ module OpenSSL::TestPairM https://github.com/ruby/ruby/blob/trunk/test/openssl/test_pair.rb#L301
     assert_equal s1, t.value
     assert accept
   ensure
-    t.join
+    t.join if t
     s1.close if s1
     s2.close if s2
     sock1.close if sock1
@@ -325,7 +325,7 @@ module OpenSSL::TestPairM https://github.com/ruby/ruby/blob/trunk/test/openssl/test_pair.rb#L325
     assert_equal s1, t.value
     assert accept
   ensure
-    t.join
+    t.join if t
     s1.close if s1
     s2.close if s2
     sock1.close if sock1
@@ -365,7 +365,7 @@ module OpenSSL::TestPairM https://github.com/ruby/ruby/blob/trunk/test/openssl/test_pair.rb#L365
 
     assert called, 'ecdh callback should be called'
   ensure
-    th.join
+    th.join if th
     s1.close if s1
     s2.close if s2
     sock1.close if sock1
@@ -413,7 +413,7 @@ module OpenSSL::TestPairM https://github.com/ruby/ruby/blob/trunk/test/openssl/test_pair.rb#L413
       assert_includes([s1, :wait_readable, :wait_writable ], rv)
     end
   ensure
-    th.join
+    th.join if th
     s1.close if s1
     s2.close if s2
     sock1.close if sock1
@@ -465,7 +465,7 @@ module OpenSSL::TestPairM https://github.com/ruby/ruby/blob/trunk/test/openssl/test_pair.rb#L465
     s1.print "a\ndef"
     assert_equal("a\n", s2.gets)
   ensure
-    th.join
+    th.join if th
     s1.close if s1 && !s1.closed?
     s2.close if s2 && !s2.closed?
     sock1.close if sock1 && !sock1.closed?

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]