123456789_123456789_123456789_123456789_123456789_

Class: ActiveRecord::ConnectionAdapters::ConnectionPool::LeaseRegistry

Do not use. This class is for internal use only.

Class Method Summary

Instance Method Summary

Constructor Details

.newLeaseRegistry

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb', line 168

def initialize
  @mutex = Mutex.new
  @map = WeakThreadKeyMap.new
end

Instance Method Details

#[](context)

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb', line 173

def [](context)
  @mutex.synchronize do
    @map[context] ||= Lease.new
  end
end

#clear

[ GitHub ]

  
# File 'activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb', line 179

def clear
  @mutex.synchronize do
    @map.clear
  end
end