Skip to content

Commit

Permalink
JAVA-652: Synchronizing on correct object in close method
Browse files Browse the repository at this point in the history
  • Loading branch information
jyemin committed Oct 9, 2012
1 parent 7c3f31f commit e257252
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/main/com/mongodb/util/SimplePool.java
Expand Up @@ -155,14 +155,12 @@ private boolean permitAcquired(final long waitTime) throws InterruptedException
}

/** Clears the pool of all objects. */
protected void close(){
synchronized( _avail ){
_closed = true;
for ( T t : _avail )
cleanup( t );
_avail.clear();
_out.clear();
}
protected synchronized void close(){
_closed = true;
for (T t : _avail)
cleanup(t);
_avail.clear();
_out.clear();
}

public String getName() {
Expand Down

0 comments on commit e257252

Please sign in to comment.