On Tue, 20 May 2025 17:20:26 GMT, Daniel Jeliński <djelin...@openjdk.org> wrote:
>> src/jdk.httpserver/share/classes/sun/net/httpserver/ServerImpl.java line 252: >> >>> 250: selector.wakeup(); >>> 251: long latest = System.nanoTime() + delay * 1000000000L; >>> 252: while (System.nanoTime() < latest) { >> >> This is not correct as `latest` may overflow. >> >> Suggestion: >> >> long start = System.nanoTime(); >> while ((System.nanoTime() - start) / 1000_000L < delay ) { > > I suppose you could also replace `finished` with a CountDownLatch and get rid > of the ugly `delay()` in a loop. Changed to the countdownlatch, so is removed in the next commit ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/25333#discussion_r2100724645