diff options
Diffstat (limited to 'lib/rainbows/thread_spawn.rb')
-rw-r--r-- | lib/rainbows/thread_spawn.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/rainbows/thread_spawn.rb b/lib/rainbows/thread_spawn.rb index 281e223..30e143e 100644 --- a/lib/rainbows/thread_spawn.rb +++ b/lib/rainbows/thread_spawn.rb @@ -24,12 +24,12 @@ module Rainbows::ThreadSpawn limit = worker_connections nr = 0 LISTENERS.each do |l| - klass.new(l) do |l| + klass.new do begin if lock.synchronize { nr >= limit } worker_yield - elsif c = l.kgio_accept - klass.new(c) do |c| + elsif client = l.kgio_accept + klass.new(client) do |c| begin lock.synchronize { nr += 1 } c.process_loop |