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:
parent
dd9e5e28ee
commit
322911cc02
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue