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,
WeakThreadKeyMap
|
|
Instance Chain:
self,
WeakThreadKeyMap
|
|
Inherits: |
ActiveRecord::ConnectionAdapters::ConnectionPool::WeakThreadKeyMap
|
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
WeakThreadKeyMap
- Inherited
.new | FIXME: On 3.3 we could use |
Instance Method Summary
-
#[](context)
See additional method definition at line 186.
- #clear
WeakThreadKeyMap
- Inherited
Constructor Details
.new ⇒ LeaseRegistry
# File 'activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb', line 192
def initialize @mutex = Mutex.new @map = WeakThreadKeyMap.new end
Instance Method Details
#[](context)
See additional method definition at line 186.
#clear
[ GitHub ]# File 'activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb', line 203
def clear @mutex.synchronize do @map.clear end end