You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by jo...@apache.org on 2011/07/20 15:45:18 UTC
svn commit: r1148769 -
/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ConnPoolByRoute.java
Author: jonm
Date: Wed Jul 20 13:45:18 2011
New Revision: 1148769
URL: http://svn.apache.org/viewvc?rev=1148769&view=rev
Log:
HTTPCLIENT-1108: backing out my earlier commit of the FIFO structure, to restore
prior functionality. I realized I didn't do this at the right level; we want to
do FIFO at the per-route connection pool level but do LIFO at the "all connections"
level. Will keep working forward on this.
Modified:
httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ConnPoolByRoute.java
Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ConnPoolByRoute.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ConnPoolByRoute.java?rev=1148769&r1=1148768&r2=1148769&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ConnPoolByRoute.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ConnPoolByRoute.java Wed Jul 20 13:45:18 2011
@@ -34,7 +34,6 @@ import java.util.Queue;
import java.util.LinkedList;
import java.util.Map;
import java.util.Set;
-import java.util.Stack;
import java.util.concurrent.locks.Condition;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.TimeUnit;
@@ -83,7 +82,7 @@ public class ConnPoolByRoute extends Abs
protected final Set<BasicPoolEntry> leasedConnections;
/** The list of free connections */
- protected final Stack<BasicPoolEntry> freeConnections;
+ protected final Queue<BasicPoolEntry> freeConnections;
/** The list of WaitingThreads waiting for a connection */
protected final Queue<WaitingThread> waitingThreads;
@@ -163,8 +162,8 @@ public class ConnPoolByRoute extends Abs
*
* @return a queue
*/
- protected Stack<BasicPoolEntry> createFreeConnQueue() {
- return new Stack<BasicPoolEntry>();
+ protected Queue<BasicPoolEntry> createFreeConnQueue() {
+ return new LinkedList<BasicPoolEntry>();
}
/**
@@ -463,7 +462,7 @@ public class ConnPoolByRoute extends Abs
}
rospl.freeEntry(entry);
entry.updateExpiry(validDuration, timeUnit);
- freeConnections.push(entry);
+ freeConnections.add(entry);
} else {
rospl.dropEntry();
numConnections--;
@@ -612,7 +611,7 @@ public class ConnPoolByRoute extends Abs
poolLock.lock();
try {
- BasicPoolEntry entry = freeConnections.pop();
+ BasicPoolEntry entry = freeConnections.remove();
if (entry != null) {
deleteEntry(entry);