ARTEMIS-1945 InVMNodeManager shared state should be volatile

State access should be atomic to be visibile between
different threads.
This commit is contained in:
Francesco Nigro 2018-06-19 18:21:03 +02:00 committed by Clebert Suconic
parent d125dcd067
commit e035487a5f
1 changed files with 2 additions and 4 deletions

View File

@ -49,7 +49,7 @@ public final class InVMNodeManager extends NodeManager {
LIVE, PAUSED, FAILING_BACK, NOT_STARTED LIVE, PAUSED, FAILING_BACK, NOT_STARTED
} }
public State state = NOT_STARTED; public volatile State state = NOT_STARTED;
public long failoverPause = 0L; public long failoverPause = 0L;
@ -147,10 +147,8 @@ public final class InVMNodeManager extends NodeManager {
@Override @Override
public void releaseBackup() { public void releaseBackup() {
if (backupLock != null) {
backupLock.release(); backupLock.release();
} }
}
@Override @Override
public SimpleString readNodeId() throws ActiveMQIllegalStateException, IOException { public SimpleString readNodeId() throws ActiveMQIllegalStateException, IOException {