Skip to content

Commit

Permalink
Remove some synchronization that's probably overkill, assuming one do…
Browse files Browse the repository at this point in the history
…esn't establish connections frequently
  • Loading branch information
nicksieger committed Aug 29, 2008
1 parent c1b9498 commit 113cc4e
Showing 1 changed file with 1 addition and 10 deletions.
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit 113cc4e

Please sign in to comment.