MNT-22712 introduced snchronized method

This commit is contained in:
gevagel
2021-12-22 10:08:28 +00:00
parent 30cd2e02ea
commit 6644585842

View File

@@ -222,18 +222,7 @@ public abstract class AbstractTracker implements Tracker
assert(assertTrackerStateRemainsNull());
}
if(this.state == null)
{
this.state = getTrackerState();
LOGGER.debug("[{} / {} / {}] Global Tracker State set to: {}", coreName, trackerId, iterationId, this.state.toString());
this.state.setRunning(true);
}
else
{
continueState();
this.state.setRunning(true);
}
updateTrackerState(iterationId);
infoSrv.registerTrackerThread();
@@ -275,6 +264,21 @@ public abstract class AbstractTracker implements Tracker
}
}
private synchronized void updateTrackerState(String iterationId) {
if(this.state == null)
{
this.state = getTrackerState();
LOGGER.debug("[{} / {} / {}] Global Tracker State set to: {}", coreName, trackerId, iterationId, this.state.toString());
}
else
{
continueState();
}
this.state.setRunning(true);
}
/**
* At the end of the tracking method, the {@link TrackerState} should be turned off.
* However, during a rollback (that could be started by another tracker) the {@link TrackerState} instance