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

* lib/monitor.rb (wait): supported timeout.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
shugo 2010-02-06 12:31:52 +00:00
parent cef8a996be
commit 332e8fe51f
2 changed files with 23 additions and 11 deletions

View file

@ -122,7 +122,7 @@ class TestMonitor < Test::Unit::TestCase
end
end
def _test_timedwait
def test_timedwait
cond = @monitor.new_cond
b = "foo"
queue2 = Queue.new
@ -153,7 +153,7 @@ class TestMonitor < Test::Unit::TestCase
@monitor.synchronize do
assert_equal("foo", c)
result3 = cond.wait(0.1)
assert_equal(false, result3)
assert_equal(true, result3) # wait always returns true in Ruby 1.9
assert_equal("foo", c)
queue3.enq(nil)
result4 = cond.wait