You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2011/07/22 23:28:29 UTC
svn commit: r1149744 -
/httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ConnPoolByRoute.java
Author: olegk
Date: Fri Jul 22 21:28:29 2011
New Revision: 1149744
URL: http://svn.apache.org/viewvc?rev=1149744&view=rev
Log:
Rolled back HTTPCLIENT-1108 changes
Modified:
httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ConnPoolByRoute.java
Modified: httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ConnPoolByRoute.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ConnPoolByRoute.java?rev=1149744&r1=1149743&r2=1149744&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ConnPoolByRoute.java (original)
+++ httpcomponents/httpclient/branches/4.1.x/httpclient/src/main/java/org/apache/http/impl/conn/tsccm/ConnPoolByRoute.java Fri Jul 22 21:28:29 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);