Hmm. `Connection.close()` is potentially a very slow call, so I hate to do it while holding the pool's lock. Could you change this into two halves: 

 * The first half is synchronized. It makes a quick copy of `connections` and clears it.
 * The 2nd half is non-synchronized. It does what your loop below does!

Reasonable?