提交 113cc4e1 编写于 作者: N Nick Sieger

Remove some synchronization that's probably overkill, assuming one doesn't...

Remove some synchronization that's probably overkill, assuming one doesn't establish connections frequently
上级 c1b94986
......@@ -161,8 +161,7 @@ def checkin(conn)
end
end
synchronize :connection, :release_connection,
:clear_reloadable_connections!, :verify_active_connections!,
synchronize :clear_reloadable_connections!, :verify_active_connections!,
:connected?, :disconnect!, :with => :@connection_mutex
private
......@@ -209,11 +208,8 @@ def checkout_and_verify(c)
end
class ConnectionHandler
attr_reader :connection_pools_lock
def initialize(pools = {})
@connection_pools = pools
@connection_pools_lock = Monitor.new
end
def connection_pools
......@@ -282,11 +278,6 @@ def retrieve_connection_pool(klass)
klass = klass.superclass
end
end
# Apply monitor to all public methods that access the pool.
synchronize :establish_connection, :retrieve_connection, :connected?, :remove_connection,
:clear_active_connections!, :clear_reloadable_connections!, :clear_all_connections!,
:verify_active_connections!, :with => :connection_pools_lock
end
end
end
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册