posted 17 years ago
notify and notifyAll will wake up one or all threads which are in the
threat-waiting pool of the object whose notify(all) methode is called.
Your question is a little confusing:
in generall, i wouldnt say "a thread is synchronized" but instead "one or more method(s) (and therefore the data accessed by this method(s) are synchronized".
to call wait on an object, a thread has to have the objects lock, which it will gain by entering a method synchronised on this object.
If now wait() is called on this object, the object`s lock is set free again for other threads and the thread calling wait is in the objects waiting pool.
Now, if an other thread gets the lock on this object, it is able to call notify on this object and therefore wake up the thread described above.
threads waiting in the waitong pool of other objects are not influenced
I hope this is helpfull
========<br />class a{<br /> a a(a a){return (a)a;}<br />}