summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-06-30 20:19:21 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-06-30 20:19:21 +0900
commit126cf11d338d6ca8b78a5a425652167d8aacc222 (patch)
treea6a8d2bc9cb63d5ad0027240f2ba179b1c5dad6e
parent75129c62ebfcd67f08262a6f755e5c899e8ebaee (diff)
Producer threads check is the primary condition
-rw-r--r--test/ruby/test_thread_queue.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/ruby/test_thread_queue.rb b/test/ruby/test_thread_queue.rb
index b5ee70d9dc..e96107cea7 100644
--- a/test/ruby/test_thread_queue.rb
+++ b/test/ruby/test_thread_queue.rb
@@ -361,7 +361,7 @@ class TestThreadQueue < Test::Unit::TestCase
items = []
# sometimes empty? is false but pop will raise ThreadError('empty'),
# meaning a value is not immediately available but will be soon.
- until q.empty? and !prod_threads.any?(&:alive?)
+ while prod_threads.any?(&:alive?) or !q.empty?
items << q.pop(true) rescue nil
end
assert_join_threads(prod_threads)