RFR: 8305092: Improve Thread.sleep(millis, nanos) for sub-millisecond granularity [v9]
David Holmes
dholmes at openjdk.org
Thu Apr 20 12:34:53 UTC 2023
On Thu, 20 Apr 2023 12:09:18 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
>> src/hotspot/os/posix/os_posix.cpp line 1342:
>>
>>> 1340: }
>>> 1341:
>>> 1342: static jlong nanos_to_nanos_bounded(jlong nanos) {
>>
>> I don't think we actually need this for nanos. There is no overflow potential and the MAX_SECS limit will be handled later.
>
> Hm, "later" where? Because I see the call to `pthread_condwait_timed` right after we produced abstime using `nanos_to_nanos_bounded`, and this looks like the last opportunity to handle the `MAX_SECS` limit:
> https://github.com/openjdk/jdk/pull/13225/files#diff-7daa601d72ef74e5281faf8256b537b4ec9c5e5c236b716902592da12fa2aad2R1582
`to_abst_time` will call ` calc_rel_time` which checks for MAX_SECS.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13225#discussion_r1172515211
More information about the core-libs-dev
mailing list