diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-10-08 20:28:00 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-10-08 20:28:00 -0700 |
commit | 966dee27d01b68283e80ea544c93f9a659145302 (patch) | |
tree | 9a30b3c27887276ca72fc21d1d00c77189b12325 | |
parent | cc50dcc4918c82cee17d9715ec4bf2d588938042 (diff) | |
download | rainbows-966dee27d01b68283e80ea544c93f9a659145302.tar.gz |
This is for compatibility with OpenBSD as reported by Jeremy Evans for Unicorn.
-rw-r--r-- | lib/rainbows/revactor.rb | 4 | ||||
-rw-r--r-- | lib/rainbows/thread_pool.rb | 4 | ||||
-rw-r--r-- | lib/rainbows/thread_spawn.rb | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/lib/rainbows/revactor.rb b/lib/rainbows/revactor.rb index 52cebf8..3375652 100644 --- a/lib/rainbows/revactor.rb +++ b/lib/rainbows/revactor.rb @@ -110,12 +110,12 @@ module Rainbows end end - nr = 0 + m = 0 begin Actor.receive do |filter| filter.after(1) do if alive - alive.chmod(nr = 0 == nr ? 1 : 0) + alive.chmod(m = 0 == m ? 1 : 0) listeners.each { |l| alive = false if l.dead? } ppid == Process.ppid or alive = false end 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 diff --git a/lib/rainbows/thread_spawn.rb b/lib/rainbows/thread_spawn.rb index 7dcd2e4..613a3f0 100644 --- a/lib/rainbows/thread_spawn.rb +++ b/lib/rainbows/thread_spawn.rb @@ -17,7 +17,7 @@ module Rainbows init_worker_process(worker) threads = ThreadGroup.new alive = worker.tmp - nr = 0 + m = 0 limit = worker_connections # closing anything we IO.select on will raise EBADF @@ -28,7 +28,7 @@ module Rainbows while alive && master_pid == Process.ppid ret = begin - alive.chmod(nr += 1) + alive.chmod(m = 0 == m ? 1 : 0) IO.select(LISTENERS, nil, nil, timeout/2.0) or next rescue Errno::EINTR retry |