diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-12 15:42:14 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-12 15:42:14 +0000 |
commit | bbcd6dfc96c0273f4bf83e89286eed03ccd2b045 (patch) | |
tree | 8628e0529aef2cd98b1f378d9a9955de0a65b76e /test/ruby/test_thread.rb | |
parent | 5734e59aed24ba2f6f77949778a29e0d9faa4f40 (diff) | |
download | ruby-bbcd6dfc96c0273f4bf83e89286eed03ccd2b045.tar.gz |
* test/ruby/test_thread.rb: add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_thread.rb')
-rw-r--r-- | test/ruby/test_thread.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb index e3a6724425..7f50f3aded 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 |