activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [2/2] activemq-artemis git commit: ARTEMIS-1945 InVMNodeManager shared state should be volatile
Date Wed, 20 Jun 2018 15:03:19 GMT
ARTEMIS-1945 InVMNodeManager shared state should be volatile

State access should be atomic to be visibile between
different threads.


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/e035487a
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/e035487a
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/e035487a

Branch: refs/heads/master
Commit: e035487a5f352e5193d10dfa7f2fdb8f68e617bf
Parents: d125dcd
Author: Francesco Nigro <nigro.fra@gmail.com>
Authored: Tue Jun 19 18:21:03 2018 +0200
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Wed Jun 20 11:02:23 2018 -0400

----------------------------------------------------------------------
 .../activemq/artemis/core/server/impl/InVMNodeManager.java     | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/e035487a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/InVMNodeManager.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/InVMNodeManager.java
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/InVMNodeManager.java
index 2719d66..a3bce41 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/InVMNodeManager.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/InVMNodeManager.java
@@ -49,7 +49,7 @@ public final class InVMNodeManager extends NodeManager {
       LIVE, PAUSED, FAILING_BACK, NOT_STARTED
    }
 
-   public State state = NOT_STARTED;
+   public volatile State state = NOT_STARTED;
 
    public long failoverPause = 0L;
 
@@ -147,9 +147,7 @@ public final class InVMNodeManager extends NodeManager {
 
    @Override
    public void releaseBackup() {
-      if (backupLock != null) {
-         backupLock.release();
-      }
+      backupLock.release();
    }
 
    @Override


Mime
View raw message