From 9eae8cdefba61e9e51feb30a4b98525593169666 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Mon, 28 Jun 2021 23:01:53 +0900 Subject: Prefer qualified names under Thread --- test/monitor/test_monitor.rb | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'test/monitor/test_monitor.rb') diff --git a/test/monitor/test_monitor.rb b/test/monitor/test_monitor.rb index 0f17d58f71..3eceee7b2e 100644 --- a/test/monitor/test_monitor.rb +++ b/test/monitor/test_monitor.rb @@ -19,7 +19,7 @@ class TestMonitor < Test::Unit::TestCase def test_enter ary = [] - queue = Queue.new + queue = Thread::Queue.new th = Thread.start { queue.pop @monitor.enter @@ -83,7 +83,7 @@ class TestMonitor < Test::Unit::TestCase def test_synchronize ary = [] - queue = Queue.new + queue = Thread::Queue.new th = Thread.start { queue.pop @monitor.synchronize do @@ -108,7 +108,7 @@ class TestMonitor < Test::Unit::TestCase def test_killed_thread_in_synchronize ary = [] - queue = Queue.new + queue = Thread::Queue.new t1 = Thread.start { queue.pop @monitor.synchronize { @@ -136,8 +136,8 @@ class TestMonitor < Test::Unit::TestCase end def test_try_enter - queue1 = Queue.new - queue2 = Queue.new + queue1 = Thread::Queue.new + queue2 = Thread::Queue.new th = Thread.start { queue1.deq @monitor.enter @@ -176,8 +176,8 @@ class TestMonitor < Test::Unit::TestCase end def test_mon_locked_and_owned - queue1 = Queue.new - queue2 = Queue.new + queue1 = Thread::Queue.new + queue2 = Thread::Queue.new th = Thread.start { @monitor.enter queue1.enq(nil) @@ -210,7 +210,7 @@ class TestMonitor < Test::Unit::TestCase cond = @monitor.new_cond a = "foo" - queue1 = Queue.new + queue1 = Thread::Queue.new th = Thread.start do queue1.deq @monitor.synchronize do @@ -262,7 +262,7 @@ class TestMonitor < Test::Unit::TestCase def test_timedwait cond = @monitor.new_cond b = "foo" - queue2 = Queue.new + queue2 = Thread::Queue.new th = Thread.start do queue2.deq @monitor.synchronize do @@ -282,7 +282,7 @@ class TestMonitor < Test::Unit::TestCase assert_join_threads([th, th2]) c = "foo" - queue3 = Queue.new + queue3 = Thread::Queue.new th = Thread.start do queue3.deq @monitor.synchronize do @@ -312,7 +312,7 @@ class TestMonitor < Test::Unit::TestCase # end # end # } -# queue3 = Queue.new +# queue3 = Thread::Queue.new # Thread.start do # queue3.pop # @monitor.synchronize do -- cgit v1.2.3