about summary refs log tree commit homepage
path: root/lib/rainbows/thread_pool.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-10-08 20:28:00 -0700
committerEric Wong <normalperson@yhbt.net>2009-10-08 20:28:00 -0700
commit966dee27d01b68283e80ea544c93f9a659145302 (patch)
tree9a30b3c27887276ca72fc21d1d00c77189b12325 /lib/rainbows/thread_pool.rb
parentcc50dcc4918c82cee17d9715ec4bf2d588938042 (diff)
downloadrainbows-966dee27d01b68283e80ea544c93f9a659145302.tar.gz
This is for compatibility with OpenBSD as reported
by Jeremy Evans for Unicorn.
Diffstat (limited to 'lib/rainbows/thread_pool.rb')
-rw-r--r--lib/rainbows/thread_pool.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/rainbows/thread_pool.rb b/lib/rainbows/thread_pool.rb
index 77bd275..16a5979 100644
--- a/lib/rainbows/thread_pool.rb
+++ b/lib/rainbows/thread_pool.rb
@@ -22,7 +22,7 @@ module Rainbows
       init_worker_process(worker)
       threads = ThreadGroup.new
       alive = worker.tmp
-      nr = 0
+      m = 0
 
       # closing anything we IO.select on will raise EBADF
       trap(:USR1) { reopen_worker_logs(worker.nr) rescue nil }
@@ -33,7 +33,7 @@ module Rainbows
       while LISTENERS.first && master_pid == Process.ppid
         maintain_thread_count(threads)
         threads.list.each do |thr|
-          alive.chmod(nr += 1)
+          alive.chmod(m = 0 == m ? 1 : 0)
           thr.join(timeout / 2.0) and break
         end
       end