On Wed, 19 Apr 2023 08:15:44 GMT, Alan Bateman <al...@openjdk.org> wrote:
>> src/java.base/share/classes/java/lang/Thread.java line 576: >> >>> 574: long millis = NANOSECONDS.toMillis(nanos); >>> 575: nanos -= MILLISECONDS.toNanos(millis); >>> 576: sleep(millis, (int)nanos); >> >> This double conversion seems a bit kludgy - why not just keep the vthread >> check and call `sleep0(nanos)`? > > Yes, I wondering that too as the method has the sleep time in nanos already > so more readable to just call sleep0(nanos). True. I was trying to merge some paths in `Thread.java` in the first revision of the patch, but after recent refactorings, we can just call into `sleep0(nanos)` and be done with it. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/13225#discussion_r1171065587