1
0
Fork 0
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:
Nobuyoshi Nakada 2019-06-30 20:19:21 +09:00
parent 75129c62eb
commit 126cf11d33
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60

View file

@ -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)