Switch to volatile for status flag used by multiple
authorrjung <rjung@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 11 Sep 2009 20:51:00 +0000 (20:51 +0000)
committerrjung <rjung@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 11 Sep 2009 20:51:00 +0000 (20:51 +0000)
threads during cluster context startup.

Without volatile problems have been observed, where the
change by one thread was actually not seen by the other
thread.

Performance implications are neglectable, because the
variable is only used during context startup.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@814024 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/ha/session/DeltaManager.java

index 8bf7b98..3eeab77 100644 (file)
@@ -112,7 +112,7 @@ public class DeltaManager extends ClusterManagerBase{
     private boolean expireSessionsOnShutdown = false;
     private boolean notifyListenersOnReplication = true;
     private boolean notifySessionListenersOnReplication = true;
-    private boolean stateTransfered = false ;
+    private volatile boolean stateTransfered = false ;
     private int stateTransferTimeout = 60;
     private boolean sendAllSessions = true;
     private boolean sendClusterDomainOnly = true ;