diff options
Diffstat (limited to 'test/monitor/test_monitor.rb')
-rw-r--r-- | test/monitor/test_monitor.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/test/monitor/test_monitor.rb b/test/monitor/test_monitor.rb index 9d07bf75f7..49c34e067e 100644 --- a/test/monitor/test_monitor.rb +++ b/test/monitor/test_monitor.rb @@ -273,24 +273,24 @@ class TestMonitor < Test::Unit::TestCase end def test_wait_interruption - queue = Queue.new cond = @monitor.new_cond - @monitor.define_singleton_method(:mon_enter_for_cond) do |*args| - queue.deq - super(*args) - end + th = Thread.start { @monitor.synchronize do begin cond.wait(0.1) + @monitor.mon_owned? rescue Interrupt - @monitor.instance_variable_get(:@mon_owner) + @monitor.mon_owned? end end } sleep(0.1) th.raise(Interrupt) - queue.enq(nil) - assert_equal th, th.value + + begin + assert_equal true, th.value + rescue Interrupt + end end end |