Skip to content

Commit

Permalink
Merge pull request #275 from JasonFengJ9/timerexectime
Browse files Browse the repository at this point in the history
Ensures time compensation is not less than checkpointRestoreTimeDelta
  • Loading branch information
tajila committed Oct 31, 2023
2 parents f215a7e + 2b3ffeb commit aa764da
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/java.base/share/classes/java/util/Timer.java
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,9 @@ private void mainLoop() {
// A zero checkpointRestoreTimeDelta value indicates no Checkpoint performed yet,
// it can't be negative, otherwise a RestoreException already was thrown.
if (checkpointRestoreTimeDelta > 0) {
// Ensure the time compensation in milliseconds is not less than the checkpoint restore time delta.
task.nextExecutionTime += (checkpointRestoreTimeDelta / 1000000);
task.nextExecutionTime += ((checkpointRestoreTimeDelta % 1000000 == 0) ? 0 : 1);
// clear the flag - only one time adjustment required
task.criuAdjustRequired = false;
}
Expand Down

0 comments on commit aa764da

Please sign in to comment.