diff --git a/.gitignore b/.gitignore index 8982d11..a0f95f2 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ dist/ scratch/ .cachedir/ memcached-release* +/bin diff --git a/src/com/meetup/memcached/SockIOPool.java b/src/com/meetup/memcached/SockIOPool.java index 6fe0c92..5377995 100644 --- a/src/com/meetup/memcached/SockIOPool.java +++ b/src/com/meetup/memcached/SockIOPool.java @@ -1066,7 +1066,7 @@ public SockIO getConnection( String host ) { * @param host host this socket is connected to * @param socket socket to add */ - protected void addSocketToPool( Map> pool, String host, SockIO socket ) { + synchronized protected void addSocketToPool( Map> pool, String host, SockIO socket ) { if ( pool.containsKey( host ) ) { Map sockets = pool.get( host ); @@ -1111,7 +1111,7 @@ protected void removeSocketFromPool( Map> pool, String h * @param pool pool to clear * @param host host to clear */ - protected void clearHostFromPool( Map> pool, String host ) { + synchronized protected void clearHostFromPool( Map> pool, String host ) { if ( pool.containsKey( host ) ) { Map sockets = pool.get( host );