diff options
| author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-10 06:02:27 +0000 |
|---|---|---|
| committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-10 06:02:27 +0000 |
| commit | d018e9b584d5361183f14c510feee749082d25c2 (patch) | |
| tree | 7218fece77f233b28c938431ffa46e2b37f96c13 /test | |
| parent | 70c2aaae0b0a80990e8b0ac383a322e1f5c80e67 (diff) | |
| download | ruby-d018e9b584d5361183f14c510feee749082d25c2.tar.gz ruby-d018e9b584d5361183f14c510feee749082d25c2.tar.xz ruby-d018e9b584d5361183f14c510feee749082d25c2.zip | |
* test/monitor/test_monitor.rb (test_cond): use Queue#deq
insteadof sleep.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
| -rw-r--r-- | test/monitor/test_monitor.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/monitor/test_monitor.rb b/test/monitor/test_monitor.rb index 658c838be..b539cb3cc 100644 --- a/test/monitor/test_monitor.rb +++ b/test/monitor/test_monitor.rb @@ -113,8 +113,9 @@ class TestMonitor < Test::Unit::TestCase end c = "foo" + queue3 = Queue.new Thread.start do - sleep(0.2) + queue3.deq @monitor.synchronize do c = "bar" cond.signal @@ -125,6 +126,7 @@ class TestMonitor < Test::Unit::TestCase result3 = cond.wait(0.1) assert_equal(false, result3) assert_equal("foo", c) + queue3.enq(nil) result4 = cond.wait assert_equal(true, result4) assert_equal("bar", c) |
