...
The notification mechanism notifies the waiting thread and lets it check its condition predicate. The invocation of notify()
or notifyAll()
in another thread cannot precisely determine which waiting thread will be resumed. A condition predicate statement is provided so that only the correct thread will resume when it receives a upon receiving the notification. A condition predicate also helps when a thread is required to block until a condition becomes true, for instance, when it should not proceed without reading some data from an input stream.
...