Delete comment from: Javarevisited
M Chisty said...
Bad explanation.
Step 1 says "The Producer thread tests the condition (buffer is full or not) and confirms that it must wait (after finding buffer is full)"
And then Step 3 says "3. The Consumer thread calls the notify () method; this goes unheard since the Producer thread is not yet waiting."
Total contradiction. Step 1 says Producer must wait; but step 3 says Producer is not waiting. No better explanation than the original poor official JavaDoc.
This explanation does not follow the standard, compared to the other articles in this blog.
Oct 19, 2016, 10:25:26 PM
Posted to Why wait, notify, and notifyAll methods are called from synchronized block or method in Java?