From a3c8175a59d9b257c3da4fd608a848c16c10bb70 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 26 Oct 2009 15:18:20 -0700 Subject: thread*: fix MRI 1.8.6 compatibility Array#count is not available until MRI 1.8.7 --- lib/rainbows/base.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rainbows/base.rb b/lib/rainbows/base.rb index 95d6545..9da148c 100644 --- a/lib/rainbows/base.rb +++ b/lib/rainbows/base.rb @@ -93,7 +93,7 @@ module Rainbows Rainbows::G.alive = false expire = Time.now + (timeout * 2.0) m = 0 - while (nr = threads.count { |thr| thr.alive? }) > 0 + until (threads.delete_if { |thr| ! thr.alive? }).empty? threads.each { |thr| worker.tmp.chmod(m = 0 == m ? 1 : 0) thr.join(1) -- cgit v1.2.3-24-ge0c7