Java Question :
Coming out of synchronization block automatically does notifyAll(). Is that the expected behavior?
I have tested it and it seems like 1. wh
You shouldn't use a Thread object as a locking object. See more explanations in question Does java notify waiting threads implicitly?.
Advertisement: Jon Skeet speaks there :) (This is a direct link to the answer in the above linked question.)
There is also another question linked from a comment, now I'll make it more achievable: who and when notify the thread.wait() when thread.join() is called?