synchronized(b)
This line implies that the
thread executing the synchronized block has a lock on the object b...??
try {
b.wait();
}
when wait() is invoked the thread gives up the lock on the object.
But I dont understand when synchronized(this) is called, it is referring to which object and which thread is executing it???