Summary
The javadoc of the method Thread#join(long, int) needs to be clarified to cover the corner case when both arguments are zeros.
Problem
Currently the documentation only says that the method makes the current thread to wait for specified amount of time. It may give a wrong impression that specifying two zeroes as the arguments will not block the execution of the current thread at all. In fact, calling Thread.join(0, 0) will make the current thread to wait forever for this thread to finish.
Solution
Add a sentence to the javadoc, covering the case millis = 0 and nanos = 0.
Specification
* Waits at most {@code millis} milliseconds plus
* {@code nanos} nanoseconds for this thread to die.
+ * If both arguments are {@code 0}, it means to wait forever.
*
- csr of
-
JDK-8210788 Javadoc for Thread.join(long, int) should specify that it waits forever when both arguments are zero
-
- Closed
-