The wait() method on an object can be called only in the synchronized context i.e. the current thread must have a lock on the object to invoke the wait()
wait()
You only need to be synchronized for the duration of calling the wait() method, not for the duration of the wait time.