On Mon, 17 May 2021 07:50:22 GMT, Stephen Colebourne <scolebou...@openjdk.org> 
wrote:

>> 8266846: Add java.time.InstantSource
>
> It would good to get confirmation in the review from @dholmes-ora or Mark 
> Kralj-Taylor that my changes to the precise system clock are correct. 
> Specifically, I moved the code from instance to static. I don't believe this 
> changes the thread-safety, but it does need double checking (there was no 
> discussion in the original thread concerning instance vs static).
> 
> Original thread: 
> http://mail.openjdk.java.net/pipermail/core-libs-dev/2020-May/066670.html

@jodastephen While an implementation can certainly implement the now() method 
there is nothing useful it can do in the JVM to get anything more than 
millisecond precision. It needs to perform the logic in currentInstant() which 
requires a call to VM.getNanoTimeAdjustment(localOffset) which it doesn't have 
access to. This is precisely why it needs to call Clock to pass in a structure 
that can be populated with the millis and nanos.

-------------

PR: https://git.openjdk.java.net/jdk/pull/4016

Reply via email to