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

ruby-changes:15702

From: nobu <ko1@a...>
Date: Wed, 5 May 2010 11:43:32 +0900 (JST)
Subject: [ruby-changes:15702] Ruby:r27623 (trunk): * bootstraptest/test_io.rb (megacontent-copy_stream): get rid of

nobu	2010-05-05 11:43:15 +0900 (Wed, 05 May 2010)

  New Revision: 27623

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

  Log:
    * bootstraptest/test_io.rb (megacontent-copy_stream): get rid of
      deadlock.

  Modified files:
    trunk/ChangeLog
    trunk/bootstraptest/test_io.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 27622)
+++ ChangeLog	(revision 27623)
@@ -1,3 +1,8 @@
+Wed May  5 11:43:10 2010  Nobuyoshi Nakada  <nobu@r...>
+
+	* bootstraptest/test_io.rb (megacontent-copy_stream): get rid of
+	  deadlock.
+
 Wed May  5 07:27:14 2010  Nobuyoshi Nakada  <nobu@r...>
 
 	* gc.c (rb_mark_method_entry): renamed.
Index: bootstraptest/test_io.rb
===================================================================
--- bootstraptest/test_io.rb	(revision 27622)
+++ bootstraptest/test_io.rb	(revision 27623)
@@ -78,7 +78,7 @@
   ARGF.set_encoding "foo"
 }
 
-1.times do
+10.times do
   assert_normal_exit %q{
     at_exit { p :foo }
 
@@ -90,11 +90,13 @@
     r1, w1 = IO.pipe
     r2, w2 = IO.pipe
     t1 = Thread.new { w1 << megacontent; w1.close }
-    t2 = Thread.new { r2.read }
+    t2 = Thread.new { r2.read; r2.close }
     IO.copy_stream(r1, w2) rescue nil
-    r2.close; w2.close
-    r1.close; w1.close
-  }, '', ["INT"] or break
+    w2.close
+    r1.close
+    t1.join
+    t2.join
+  }, 'megacontent-copy_stream', ["INT"], :timeout => 10 or break
 end
 
 assert_normal_exit %q{

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

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