Permalink
Browse files

JAVA-652: Synchronizing on correct object in close method

  • Loading branch information...
1 parent 7c3f31f commit e257252298e70dd8e0bf6f7d893b4ecae86332e5 @jyemin jyemin committed Oct 9, 2012
Showing with 6 additions and 8 deletions.
  1. +6 −8 src/main/com/mongodb/util/SimplePool.java
@@ -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() {

0 comments on commit e257252

Please sign in to comment.