InterThread Communication
Inter-thread communication methods are declared in java.lang.Object.
Each object could be associated with a monitor (a sort of thread lock).
wait()
- Suspend the thread.
- Wait can also be time limited.
notify()
- Unlock the first monitored thread.
- (The first that called wait() within the monitor.)
notifyAll()
- Unlocks all monitored threads.
- Highest prioritised first!