Thank you for the insight Henry !!
For proof, I tested that these two variants of the
Test class and they DO wait forever:
Now, I have a question about the following point:
Henry Wong wrote:When any thread completes, as part of the clean up process, a notifyAll() is done to wake up the threads waiting to join().
Does this mean that every thread
(or the cleaner object) must acquire a lock on itself
(or the thread object) before the thread finishes its work? (
because it must make a call to notifyAll(); )