We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ca21111 commit fb4e23dCopy full SHA for fb4e23d
lib/puma/thread_pool.rb
@@ -53,15 +53,17 @@ def spawn_thread
53
@spawned += 1
54
55
th = Thread.new do
56
- todo = @todo
+ todo = @todo
57
block = @block
58
+ mutex = @mutex
59
+ cond = @cond
60
61
while true
62
work = nil
63
64
continue = true
65
- @mutex.synchronize do
66
+ mutex.synchronize do
67
while todo.empty?
68
if @trim_requested > 0
69
@trim_requested -= 1
@@ -75,7 +77,7 @@ def spawn_thread
75
77
end
76
78
79
@waiting += 1
- @cond.wait @mutex
80
+ cond.wait mutex
81
@waiting -= 1
82
83
if @shutdown
@@ -92,7 +94,7 @@ def spawn_thread
92
94
block.call work
93
95
96
97
98
@spawned -= 1
99
@workers.delete th
100
0 commit comments