Returns a synchronized (thread-safe) ObjectPool backed by the specified
ObjectPool.
<p>
<b>Note:</b> This should not be used on pool implementations that already
provide proper synchronization such as the pools provided in the Commons
Pool library. Wrapping a pool that {@link #wait() waits} for poolable
objects to be returned before allowing another one to be borrowed with
another layer of synchronization will cause liveliness issues or a
deadlock.
</p>
@param pool
the ObjectPool to be "wrapped" in a synchronized ObjectPool.
@param <T> the type of objects in the pool
@return a synchronized view of the specified ObjectPool.
Returns a synchronized (thread-safe) ObjectPool backed by the specified ObjectPool. <p> <b>Note:</b> This should not be used on pool implementations that already provide proper synchronization such as the pools provided in the Commons Pool library. Wrapping a pool that {@link #wait() waits} for poolable objects to be returned before allowing another one to be borrowed with another layer of synchronization will cause liveliness issues or a deadlock. </p>
@param pool the ObjectPool to be "wrapped" in a synchronized ObjectPool. @param <T> the type of objects in the pool @return a synchronized view of the specified ObjectPool.