RFR: 8305092: Improve Thread.sleep(millis, nanos) for sub-millisecond granularity [v9]
Aleksey Shipilev
shade at openjdk.org
Thu Apr 20 12:12:52 UTC 2023
On Thu, 20 Apr 2023 12:04:38 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Handle overflows
>
> 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
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13225#discussion_r1172492842
More information about the core-libs-dev
mailing list