HTTPCLIENT-625 for 4.0
git-svn-id: https://svn.apache.org/repos/asf/jakarta/httpcomponents/httpclient/trunk@506063 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9ce698c4d5
commit
12d50dda30
|
@ -117,7 +117,7 @@ public class ThreadSafeClientConnManager
|
|||
private ClientConnectionOperator connectionOperator;
|
||||
|
||||
/** Indicates whether this connection manager is shut down. */
|
||||
private boolean isShutDown;
|
||||
private volatile boolean isShutDown;
|
||||
|
||||
|
||||
|
||||
|
@ -1011,7 +1011,7 @@ public class ThreadSafeClientConnManager
|
|||
*/
|
||||
private static class ReferenceQueueThread extends Thread {
|
||||
|
||||
private boolean isShutDown = false;
|
||||
private volatile boolean isShutDown = false;
|
||||
|
||||
/**
|
||||
* Create an instance and make this a daemon thread.
|
||||
|
@ -1023,6 +1023,7 @@ public class ThreadSafeClientConnManager
|
|||
|
||||
public void shutdown() {
|
||||
this.isShutDown = true;
|
||||
this.interrupt();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1056,10 +1057,8 @@ public class ThreadSafeClientConnManager
|
|||
public void run() {
|
||||
while (!isShutDown) {
|
||||
try {
|
||||
// remove the next reference and process it, a timeout
|
||||
// is used so that the thread does not block indefinitely
|
||||
// and therefore keep the thread from shutting down
|
||||
Reference ref = REFERENCE_QUEUE.remove(1000);
|
||||
// remove the next reference and process it
|
||||
Reference ref = REFERENCE_QUEUE.remove();
|
||||
if (ref != null) {
|
||||
handleReference(ref);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue