If there is no thread which is waiting, using Object.wait() , any calls to Object.notify() or Object.notifyAll() have no effect. I hav
Object.wait()
Object.notify()
Object.notifyAll()
This kind of scenario seems to be a perfect fit for a Semaphore. Call Semaphore.release() instead of notify() and Semaphore.acquire() instead of wait.
Semaphore
Semaphore.release()
notify()
Semaphore.acquire()