notifyAll() (cont’d)
There are two versions - notify() and
notifyAll().
Notify is safe only under 2 conditions:
When only 1 thread is waiting, and thus
guaranteed to be awakened.
When multiple threads are waiting on the
same condition, and it doesn’t matter
which one awakens.
In general, use notifyAll()