class PhusionPassenger::AbstractServerCollection
def synchronize
the code within the block. The entire block will be a single atomic
Acquire the lock for this AbstractServerCollection object, and run
def synchronize @lock.synchronize do yield if @next_cleaning_time.nil? @collection.each_value do |server| if @next_cleaning_time.nil? || (eligable_for_cleanup?(server) && server.next_cleaning_time < @next_cleaning_time ) @next_cleaning_time = server.next_cleaning_time end end if @next_cleaning_time.nil? # There are no servers in the collection with an idle timeout. @next_cleaning_time = Time.now + 60 * 60 end @next_cleaning_time_changed = true end if @next_cleaning_time_changed @next_cleaning_time_changed = false @cond.signal end end end