From: rjung Date: Fri, 11 Sep 2009 20:51:00 +0000 (+0000) Subject: Switch to volatile for status flag used by multiple X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=aa969e556dcf679a49fbc964648665aae18a1fa6;p=tomcat7.0 Switch to volatile for status flag used by multiple 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 --- diff --git a/java/org/apache/catalina/ha/session/DeltaManager.java b/java/org/apache/catalina/ha/session/DeltaManager.java index 8bf7b9891..3eeab7787 100644 --- a/java/org/apache/catalina/ha/session/DeltaManager.java +++ b/java/org/apache/catalina/ha/session/DeltaManager.java @@ -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 ;