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

ruby-changes:14650

From: yugui <ko1@a...>
Date: Sat, 30 Jan 2010 22:06:43 +0900 (JST)
Subject: [ruby-changes:14650] Ruby:r26498 (ruby_1_9_1): merges r25418 from trunk into ruby_1_9_1.

yugui	2010-01-30 21:51:35 +0900 (Sat, 30 Jan 2010)

  New Revision: 26498

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

  Log:
    merges r25418 from trunk into ruby_1_9_1.
    --
     * added monitor.rb test. see #2240 the bug on ruby_1_8.

  Modified files:
    branches/ruby_1_9_1/test/monitor/test_monitor.rb
    branches/ruby_1_9_1/version.h

Index: ruby_1_9_1/version.h
===================================================================
--- ruby_1_9_1/version.h	(revision 26497)
+++ ruby_1_9_1/version.h	(revision 26498)
@@ -1,5 +1,5 @@
 #define RUBY_VERSION "1.9.1"
-#define RUBY_PATCHLEVEL 403
+#define RUBY_PATCHLEVEL 404
 #define RUBY_VERSION_MAJOR 1
 #define RUBY_VERSION_MINOR 9
 #define RUBY_VERSION_TEENY 1
Index: ruby_1_9_1/test/monitor/test_monitor.rb
===================================================================
--- ruby_1_9_1/test/monitor/test_monitor.rb	(revision 26497)
+++ ruby_1_9_1/test/monitor/test_monitor.rb	(revision 26498)
@@ -54,6 +54,32 @@
     assert_equal((1..10).to_a, ary)
   end
 
+  def test_killed_thread_in_synchronize
+    ary = []
+    queue = Queue.new
+    t1 = Thread.start {
+      queue.pop
+      @monitor.synchronize {
+        ary << :t1
+      }
+    }
+    t2 = Thread.start {
+      queue.pop
+      @monitor.synchronize {
+        ary << :t2
+      }
+    }
+    @monitor.synchronize do
+      queue.enq(nil)
+      queue.enq(nil)
+      assert_equal([], ary)
+      t1.kill
+      t2.kill
+      ary << :main
+    end
+    assert_equal([:main], ary)
+  end
+
   def test_try_enter
     queue1 = Queue.new
     queue2 = Queue.new
@@ -97,6 +123,7 @@
   end
 
   def _test_timedwait
+    cond = @monitor.new_cond
     b = "foo"
     queue2 = Queue.new
     Thread.start do

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

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