The specified amount of real time has elapsed, more or less. The amount of real time, measured in milliseconds, is given by millis . If millis is zero, however, then real time is not taken into consideration and the thread simply waits until notified. The thread T is then removed from the wait set for this object and re-enabled for thread scheduling. Thread T then returns from the invocation of the wait method.
T is exactly as it was when the wait method was invoked.
This exception is not thrown until the lock status of this object has been restored as described above. The choice is arbitrary and at the discretion of the implementation. The notify method may be called only when the current thread is already synchronized on this object. If the current thread does not own the lock on this object, an IllegalMonitorStateException is thrown. The awakened thread will not be able to proceed until the current thread relinquishes the lock on this object.