summaryrefslogtreecommitdiff
path: root/test/thread/test_queue.rb
diff options
context:
space:
mode:
authorkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-30 18:55:09 +0000
committerkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-30 18:55:09 +0000
commit3357d88ada8ad44ecf267f5f2a1fb1df4e5cb8f4 (patch)
tree6053a9051f0bed2ba5ba52adaab996817eb35bb4 /test/thread/test_queue.rb
parente742a446c8864e3988537d06022312c708f9e176 (diff)
* lib/thread.rb (SizedQueue#pop): rewrite by using ConditionVariable.
* lib/thread.rb (SizedQueue#push): ditto. * lib/thread.rb (SizedQueue#max): ditto. * lib/thread.rb (Queue#pop): ditto. * lib/thread.rb (Queue#push): ditto. * lib/thread.rb (SizedQueue#num_waiting): adopt the above changes. * lib/thread.rb (SizedQueue#initialize): ditto. * lib/thread.rb (Queue#num_waiting): ditto. * lib/thread.rb (Queue#initialize): ditto. * test/thread/test_queue.rb (test_sized_queue_and_wakeup): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38087 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/thread/test_queue.rb')
-rw-r--r--test/thread/test_queue.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/thread/test_queue.rb b/test/thread/test_queue.rb
index 84e60d6..b6fbbae 100644
--- a/test/thread/test_queue.rb
+++ b/test/thread/test_queue.rb
@@ -69,7 +69,8 @@ class TestQueue < Test::Unit::TestCase
t2 = Thread.start { sq.push(2) }
sleep 0.1 until t1.stop? && t2.stop?
- queue_wait = sq.instance_eval{ @queue_wait }
+ enque_cond = sq.instance_eval{ @enque_cond }
+ queue_wait = enque_cond.instance_eval { @waiters }
assert_equal(queue_wait.uniq, queue_wait)
end