diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-06-30 20:19:21 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-06-30 20:19:21 +0900 |
commit | 126cf11d338d6ca8b78a5a425652167d8aacc222 (patch) | |
tree | a6a8d2bc9cb63d5ad0027240f2ba179b1c5dad6e | |
parent | 75129c62ebfcd67f08262a6f755e5c899e8ebaee (diff) | |
download | ruby-126cf11d338d6ca8b78a5a425652167d8aacc222.tar.gz |
Producer threads check is the primary condition
-rw-r--r-- | test/ruby/test_thread_queue.rb | 2 |
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) |