All other accesses to numConnections use poolLock to lock.

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@756314 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sebastian Bazley 2009-03-20 02:33:50 +00:00
parent dd9e5e28ee
commit 322911cc02
1 changed files with 5 additions and 3 deletions

View File

@ -261,9 +261,11 @@ public class ThreadSafeClientConnManager implements ClientConnectionManager {
* @return the total number of pooled connections
*/
public int getConnectionsInPool() {
synchronized (connectionPool) {
return connectionPool.numConnections; //@@@
}
int count;
connectionPool.poolLock.lock();
count = connectionPool.numConnections; //@@@
connectionPool.poolLock.unlock();
return count;
}