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

ruby-changes:5607

From: mame <ko1@a...>
Date: Fri, 13 Jun 2008 00:42:33 +0900 (JST)
Subject: [ruby-changes:5607] Ruby:r17114 (trunk): * test/ruby/test_thread.rb: add a test.

mame	2008-06-13 00:42:14 +0900 (Fri, 13 Jun 2008)

  New Revision: 17114

  Modified files:
    trunk/ChangeLog
    trunk/test/ruby/test_thread.rb

  Log:
    * test/ruby/test_thread.rb: add a test.


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=17114&r2=17113&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/ruby/test_thread.rb?r1=17114&r2=17113&diff_format=u

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 17113)
+++ ChangeLog	(revision 17114)
@@ -1,3 +1,7 @@
+Fri Jun 13 00:41:58 2008  Yusuke Endoh  <mame@t...>
+
+	* test/ruby/test_thread.rb: add a test.
+
 Thu Jun 12 23:30:11 2008  Yusuke Endoh  <mame@t...>
 
 	* thread.c (mutex_unlock): fix cond_notified consistency.
Index: test/ruby/test_thread.rb
===================================================================
--- test/ruby/test_thread.rb	(revision 17113)
+++ test/ruby/test_thread.rb	(revision 17114)
@@ -439,6 +439,28 @@
     end
   end
 
+  def test_mutex_fifo_like_lock
+    m1 = Mutex.new
+    m2 = Mutex.new
+    m1.lock
+    m2.lock
+    m1.unlock
+    m2.unlock
+    assert_equal(false, m1.locked?)
+    assert_equal(false, m2.locked?)
+
+    m3 = Mutex.new
+    m1.lock
+    m2.lock
+    m3.lock
+    m1.unlock
+    m2.unlock
+    m3.unlock
+    assert_equal(false, m1.locked?)
+    assert_equal(false, m2.locked?)
+    assert_equal(false, m3.locked?)
+  end
+
   def test_recursive_error
     o = Object.new
     def o.inspect

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

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