java: wait(), notify() and synchronized blocks
I learned that calling an Object's wait() method will release the object monitor, if present. But I have some questions regarding calling notify() on this object by another thread: (when) will the waiting thread wake up, if another (a 3rd) thread owns the object monitor in the meanwhile? will the waiting thread wake up, if a 3rd thread called wait() on this object? is it possible to determine if a thread is waiting for notifying a particular object (java 1.4/java 5) What's happening if wait() will be called in the finalize() method? notify will wake one thread waiting on the monitor. Unless