}
}
catch (@SuppressWarnings("unused") InterruptedException e)
- {// do nothing; it is normal execution flow to be interrupted
+ { // do nothing; it is normal execution flow to be interrupted
}
}
}
timeline.addEventAddedListener(event ->
{
if (isRunningLive.get())
- if (Timeline.timeCmp(event.getTiming(), nextExecSimulTime.get()) < 0)
+ {
+ long nextExecSimulTime = this.nextExecSimulTime.get();
+ if (nextExecSimulTime == -1 || Timeline.timeCmp(event.getTiming(), nextExecSimulTime) < 0)
simulationThread.interrupt();
+ }
});
// not optimal; but we don't expect this to happen very often
tf.addSimulTimeToRealTimeFactorChangedListener(d -> simulationThread.interrupt());