hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rola...@apache.org
Subject svn commit: r506063 - /jakarta/httpcomponents/httpclient/trunk/src/java/org/apache/http/impl/conn/ThreadSafeClientConnManager.java
Date Sun, 11 Feb 2007 16:26:39 GMT
Author: rolandw
Date: Sun Feb 11 08:26:38 2007
New Revision: 506063

URL: http://svn.apache.org/viewvc?view=rev&rev=506063
Log:
HTTPCLIENT-625 for 4.0

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

Modified: jakarta/httpcomponents/httpclient/trunk/src/java/org/apache/http/impl/conn/ThreadSafeClientConnManager.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/src/java/org/apache/http/impl/conn/ThreadSafeClientConnManager.java?view=diff&rev=506063&r1=506062&r2=506063
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/src/java/org/apache/http/impl/conn/ThreadSafeClientConnManager.java
(original)
+++ jakarta/httpcomponents/httpclient/trunk/src/java/org/apache/http/impl/conn/ThreadSafeClientConnManager.java
Sun Feb 11 08:26:38 2007
@@ -117,7 +117,7 @@
     private ClientConnectionOperator connectionOperator;
 
     /** Indicates whether this connection manager is shut down. */
-    private boolean isShutDown;
+    private volatile boolean isShutDown;
     
 
 
@@ -1011,7 +1011,7 @@
      */
     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 void shutdown() {
             this.isShutDown = true;
+            this.interrupt();
         }
         
         /**
@@ -1056,10 +1057,8 @@
         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);
                     }



Mime
View raw message