hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r756314 - /httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java
Date Fri, 20 Mar 2009 02:33:51 GMT
Author: sebb
Date: Fri Mar 20 02:33:50 2009
New Revision: 756314

URL: http://svn.apache.org/viewvc?rev=756314&view=rev
Log:
All other accesses to numConnections use poolLock to lock.

Modified:
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java?rev=756314&r1=756313&r2=756314&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.java
Fri Mar 20 02:33:50 2009
@@ -261,9 +261,11 @@
      * @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;
     }
 
 



Mime
View raw message