Skip to content

Commit

Permalink
Merge pull request #723 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 authored Oct 31, 2023
2 parents d4a63e5 + 9e1f46b commit 4d681f3
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 @@ -578,7 +578,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 4d681f3

Please sign in to comment.