On Mon, 17 May 2021 17:19:19 GMT, Stephen Colebourne <scolebou...@openjdk.org> wrote:
>> 8266846: Add java.time.InstantSource > > Stephen Colebourne has updated the pull request incrementally with one > additional commit since the last revision: > > 8266846: Add java.time.InstantSource Changes requested by plevart (Reviewer). src/java.base/share/classes/java/time/Clock.java line 487: > 485: // it more unlikely to hit the 1ns in the future condition. > 486: localOffset = System.currentTimeMillis()/1000 - 1024; > 487: Is it possible that after a fresh localOffset is retrieved, the thread is preempted and when it is scheduled again after a pause, the getNanoTimeAdjustment below returns -1 ? Would it help if instead of throwing exception, there was an infinite retry loop? ------------- PR: https://git.openjdk.java.net/jdk/pull/4016