mirror of
https://github.com/puma/puma.git
synced 2022-11-09 13:48:40 -05:00
Syncronize all access to @timeouts. Fixes #208
This commit is contained in:
parent
4d3c85876b
commit
b61a372ada
1 changed files with 13 additions and 9 deletions
|
@ -50,8 +50,10 @@ module Puma
|
|||
# list or we'll accidentally close the socket when
|
||||
# it's in use!
|
||||
if c.timeout_at
|
||||
@mutex.synchronize do
|
||||
@timeouts.delete c
|
||||
end
|
||||
end
|
||||
|
||||
begin
|
||||
if c.try_to_finish
|
||||
|
@ -78,6 +80,7 @@ module Puma
|
|||
end
|
||||
|
||||
unless @timeouts.empty?
|
||||
@mutex.synchronize do
|
||||
now = Time.now
|
||||
|
||||
while @timeouts.first.timeout_at < now
|
||||
|
@ -91,6 +94,7 @@ module Puma
|
|||
calculate_sleep
|
||||
end
|
||||
end
|
||||
end
|
||||
ensure
|
||||
@trigger.close
|
||||
@ready.close
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue