summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-12 15:42:14 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-12 15:42:14 +0000
commit839c12d26d89645509c8ab5789620456793a534e (patch)
tree8628e0529aef2cd98b1f378d9a9955de0a65b76e
parent546ccf2049e7bd8eb3ea1cf8929f11f5af9c0873 (diff)
downloadruby-839c12d26d89645509c8ab5789620456793a534e.tar.gz
ruby-839c12d26d89645509c8ab5789620456793a534e.tar.xz
ruby-839c12d26d89645509c8ab5789620456793a534e.zip
* test/ruby/test_thread.rb: add a test.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--test/ruby/test_thread.rb22
2 files changed, 26 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 20e502e48..8be2fa40b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Fri Jun 13 00:41:58 2008 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * test/ruby/test_thread.rb: add a test.
+
Thu Jun 12 23:30:11 2008 Yusuke Endoh <mame@tsg.ne.jp>
* thread.c (mutex_unlock): fix cond_notified consistency.
diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb
index e3a672442..7f50f3ade 100644
--- a/test/ruby/test_thread.rb
+++ b/test/ruby/test_thread.rb
@@ -439,6 +439,28 @@ class TestThread < Test::Unit::TestCase
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