1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
mame 2008-06-12 15:42:14 +00:00
parent 5734e59aed
commit bbcd6dfc96
2 changed files with 26 additions and 0 deletions

View file

@ -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.

View file

@ -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