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:
parent
ca21111666
commit
fb4e23d628
1 changed files with 6 additions and 4 deletions
|
@ -53,15 +53,17 @@ module Puma
|
|||
@spawned += 1
|
||||
|
||||
th = Thread.new do
|
||||
todo = @todo
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue