Skip to content

Commit

Permalink
Merge branch 'hashmap_thread_safety'
Browse files Browse the repository at this point in the history
  • Loading branch information
Ed Ceaser committed Feb 12, 2010
2 parents 6fd1a0f + 4e84c3a commit b569d4e
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -3,7 +3,7 @@ package com.twitter.querulous.connectionpool
import scala.collection.mutable

class MemoizingConnectionPoolFactory(connectionPoolFactory: ConnectionPoolFactory) extends ConnectionPoolFactory {
private val connectionPools = new mutable.HashMap[String, ConnectionPool]
private val connectionPools = new mutable.HashMap[String, ConnectionPool] with mutable.SynchronizedMap[String, ConnectionPool]

def apply(dbhosts: List[String], dbname: String, username: String, password: String) = synchronized {
connectionPools.getOrElseUpdate(
Expand Down

0 comments on commit b569d4e

Please sign in to comment.