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

Aleksey Shipilev shade at openjdk.org
Wed Apr 19 09:30:59 UTC 2023


On Wed, 19 Apr 2023 05:58:35 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Fix gtests
>
> src/hotspot/os/windows/os_windows.cpp line 5259:
> 
>> 5257:   // any positive requested nanos as a full millisecond.
>> 5258:   jlong millis = align_up(nanos, NANOSECS_PER_MILLISEC) / NANOSECS_PER_MILLISEC;
>> 5259:   assert(nanos == 0 || millis != 0, "Only pass zero millis on zero nanos");
> 
> Not sure what this is trying to check.
> 
> Nit: s/on/or/

Right, I thought we are allowed to pass zero downstream, but there is a `guarantee(Millis > 0)`, which would fail. So there is no reason to do this. Fixed.

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

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


More information about the core-libs-dev mailing list