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

ruby-changes:14737

From: shugo <ko1@a...>
Date: Sat, 6 Feb 2010 21:41:04 +0900 (JST)
Subject: [ruby-changes:14737] Ruby:r26596 (trunk): * test/net/imap/test_imap.rb (test_exception_during_idle): use timeout.

shugo	2010-02-06 21:31:59 +0900 (Sat, 06 Feb 2010)

  New Revision: 26596

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

  Log:
    * test/net/imap/test_imap.rb (test_exception_during_idle): use timeout.

  Modified files:
    trunk/test/net/imap/test_imap.rb

Index: test/net/imap/test_imap.rb
===================================================================
--- test/net/imap/test_imap.rb	(revision 26595)
+++ test/net/imap/test_imap.rb	(revision 26596)
@@ -215,16 +215,25 @@
         begin
           th = Thread.current
           m = Monitor.new
+          in_idle = false
+          exception_raised = false
           c = m.new_cond
           Thread.start do
             m.synchronize do
-              c.wait
+              until in_idle
+                c.wait(0.1)
+              end
             end
             th.raise(Interrupt)
+            exception_raised = true
           end
           imap.idle do |res|
             m.synchronize do
+              in_idle = true
               c.signal
+              until exception_raised
+                c.wait(0.1)
+              end
             end
           end
         rescue Interrupt

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

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