Permalink
Browse files

Merge branch 'hashmap_thread_safety'

  • Loading branch information...
2 parents 6fd1a0f + 4e84c3a commit b569d4ec38269c8c4922592a43977917b434cde2 Ed Ceaser committed Feb 12, 2010
View
2 src/main/scala/com/twitter/querulous/connectionpool/MemoizingConnectionPoolFactory.scala
@@ -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(

0 comments on commit b569d4e

Please sign in to comment.