1
0
Fork 0
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:
Evan Phoenix 2013-03-18 16:41:59 -07:00
parent 4d3c85876b
commit b61a372ada

View file

@ -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