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

ruby-changes:34225

From: akr <ko1@a...>
Date: Mon, 2 Jun 2014 09:46:47 +0900 (JST)
Subject: [ruby-changes:34225] akr:r46285 (trunk): Join threads.

akr	2014-05-31 23:48:12 +0900 (Sat, 31 May 2014)

  New Revision: 46285

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

  Log:
    Join threads.

  Modified files:
    trunk/test/ruby/test_marshal.rb
Index: test/ruby/test_marshal.rb
===================================================================
--- test/ruby/test_marshal.rb	(revision 46284)
+++ test/ruby/test_marshal.rb	(revision 46285)
@@ -102,17 +102,21 @@ class TestMarshal < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_marshal.rb#L102
   def test_pipe
     o1 = C.new("a" * 10000)
 
+    th = nil
+
     o2 = IO.pipe do |r, w|
-      Thread.new {Marshal.dump(o1, w)}
+      th = Thread.new {Marshal.dump(o1, w)}
       Marshal.load(r)
     end
     assert_equal(o1.str, o2.str)
+    th.join
 
     o2 = IO.pipe do |r, w|
-      Thread.new {Marshal.dump(o1, w, 2)}
+      th = Thread.new {Marshal.dump(o1, w, 2)}
       Marshal.load(r)
     end
     assert_equal(o1.str, o2.str)
+    th.join
 
     assert_raise(TypeError) { Marshal.dump("foo", Object.new) }
     assert_raise(TypeError) { Marshal.load(Object.new) }

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

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