ruby-changes:56293
From: Nobuyoshi <ko1@a...>
Date: Sun, 30 Jun 2019 20:19:41 +0900 (JST)
Subject: [ruby-changes:56293] Nobuyoshi Nakada: 126cf11d33 (trunk): Producer threads check is the primary condition
https://git.ruby-lang.org/ruby.git/commit/?id=126cf11d33 From 126cf11d338d6ca8b78a5a425652167d8aacc222 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Sun, 30 Jun 2019 20:19:21 +0900 Subject: Producer threads check is the primary condition diff --git a/test/ruby/test_thread_queue.rb b/test/ruby/test_thread_queue.rb index b5ee70d..e96107c 100644 --- a/test/ruby/test_thread_queue.rb +++ b/test/ruby/test_thread_queue.rb @@ -361,7 +361,7 @@ class TestThreadQueue < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_thread_queue.rb#L361 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) -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/