JDK-8210004 : Thread.sleep(millis, nanos) timeout returns early
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-08-27
  • Updated: 2019-03-13
  • Resolved: 2018-09-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 12
12 b12Fixed
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Description
In 
JDK-8065372: Object.wait(ms, ns) timeout returns early
we fixed Object.wait to not return early by rounding non-zero nanos up to the next millisecond.
We should make the same change to Thread.sleep
Comments
Thread.join(ns, nanos) also. (Did you mean round up the millis). Object.wait does: if (nanos > 0) { timeoutMillis++; } Both methods are specified as "waits at most", but rounding up will prevent early returns.
29-08-2018