1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

Add missing localvars. Accessing localvars is faster than accessing ivars

This commit is contained in:
Santiago Pastorino 2012-07-05 16:05:29 -03:00
parent ca21111666
commit fb4e23d628

View file

@ -55,13 +55,15 @@ module Puma
th = Thread.new do
todo = @todo
block = @block
mutex = @mutex
cond = @cond
while true
work = nil
continue = true
@mutex.synchronize do
mutex.synchronize do
while todo.empty?
if @trim_requested > 0
@trim_requested -= 1
@ -75,7 +77,7 @@ module Puma
end
@waiting += 1
@cond.wait @mutex
cond.wait mutex
@waiting -= 1
if @shutdown
@ -92,7 +94,7 @@ module Puma
block.call work
end
@mutex.synchronize do
mutex.synchronize do
@spawned -= 1
@workers.delete th
end