Class: ActiveRecord::ConnectionAdapters::ConnectionPool::LeaseRegistry
Do not use. This class is for internal use only.
| Relationships & Source Files | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
self,
ObjectSpace::WeakKeyMap
|
|
|
Instance Chain:
self,
ObjectSpace::WeakKeyMap
|
|
| Inherits: | ObjectSpace::WeakKeyMap |
| Defined in: | activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb, activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb |
Overview
Thanks to the GVL, the LeaseRegistry doesn't need to be synchronized on MRI
Class Method Summary
- .new ⇒ LeaseRegistry constructor
Instance Method Summary
-
#[](context)
See additional method definition at line 164.
- #clear
Constructor Details
.new ⇒ LeaseRegistry
# File 'activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb', line 170
def initialize @mutex = Mutex.new @map = ObjectSpace::WeakKeyMap.new end
Instance Method Details
#[](context)
See additional method definition at line 164.
#clear
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb', line 181
def clear @mutex.synchronize do @map.clear end end