Posted By:
Alex_Chaffee
Posted On:
Friday, October 26, 2001 12:41 PM
Each thread would be waiting on the object attached to its own Thread object. There is no contention between different threads as long as they are using
synchronized (this) {
this.wait();
}
when created, and
synchronized (this) {
this.notify();
}
to wake up (assuming the notify is called on the same Thread object, but from inside a different (manager) thread).
It's confusing that there's two totally separate things with the same name -- thread and java.lang.Thread -- especially since the thread starts its life inside the Thread's run() method and so forth.