mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Producer threads check is the primary condition
This commit is contained in:
parent
75129c62eb
commit
126cf11d33
1 changed files with 1 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue