RFR: 8305092: Improve Thread.sleep(millis, nanos) for sub-millisecond granularity [v3]

David Holmes dholmes at openjdk.org
Wed Apr 19 06:17:55 UTC 2023


On Wed, 19 Apr 2023 06:09:28 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> src/hotspot/os/windows/os_windows.cpp line 5257:
>> 
>>> 5255:   // Windows timers are still quite unpredictable to handle sub-millisecond granularity.
>>> 5256:   // Instead of implementing this method, fall back to the millisecond sleep, treating
>>> 5257:   // any positive requested nanos as a full millisecond.
>> 
>> Is this how the code currently works?
>
> Hmmm I changed that comment ...

My actual comment was changed to:
> I suggest extending the comment to add

This is how Thread.sleep(millis, nanos) has always behaved with only millisecond granularity.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13225#discussion_r1170850062


More information about the core-libs-dev mailing list