manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1471550 - /manifoldcf/trunk/connectors/rss/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/rss/ThrottledFetcher.java
Date Wed, 24 Apr 2013 17:25:41 GMT
Author: kwright
Date: Wed Apr 24 17:25:41 2013
New Revision: 1471550

URL: http://svn.apache.org/r1471550
Log:
Add volatile modifier to some throttlebin member variables, to prevent the optimizer from
doing stupid things with them.

Modified:
    manifoldcf/trunk/connectors/rss/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/rss/ThrottledFetcher.java

Modified: manifoldcf/trunk/connectors/rss/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/rss/ThrottledFetcher.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/rss/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/rss/ThrottledFetcher.java?rev=1471550&r1=1471549&r2=1471550&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/rss/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/rss/ThrottledFetcher.java
(original)
+++ manifoldcf/trunk/connectors/rss/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/rss/ThrottledFetcher.java
Wed Apr 24 17:25:41 2013
@@ -960,19 +960,19 @@ public class ThrottledFetcher
   protected class Server
   {
     /** The fqdn of the server */
-    protected String serverName;
+    protected final String serverName;
     /** This is the time of the next allowed fetch (in ms since epoch) */
     protected long nextFetchTime = 0L;
 
     // Bandwidth throttling variables
     /** Reference count for bandwidth variables */
-    protected int refCount = 0;
+    protected volatile int refCount = 0;
     /** The inverse rate estimate of the first fetch, in ms/byte */
     protected double rateEstimate = 0.0;
     /** Flag indicating whether a rate estimate is needed */
-    protected boolean estimateValid = false;
+    protected volatile boolean estimateValid = false;
     /** Flag indicating whether rate estimation is in progress yet */
-    protected boolean estimateInProgress = false;
+    protected volatile boolean estimateInProgress = false;
     /** The start time of this series */
     protected long seriesStartTime = -1L;
     /** Total actual bytes read in this series; this includes fetches in progress */
@@ -982,7 +982,7 @@ public class ThrottledFetcher
     protected Integer firstChunkLock = new Integer(0);
 
     /** Outstanding connection counter */
-    protected int outstandingConnections = 0;
+    protected volatile int outstandingConnections = 0;
 
     /** Constructor */
     public Server(String serverName)



Mime
View raw message