Dawid Skrzypczynski wrote:
Why method wait() doesn't work ?
The wait method causes the current
thread to wait for notification. It doesn't cause the thread, represented by the thread object that you are using to wait. Notice that it is a method of the object class, and not the thread class.
As for why the instance is needed, it is related to how condition variables work.
Henry