This can happen only if the call to a.join in main thread released the lock on object 'a' which is contrary to what the author says.
Yes, you are correct.
The main thread creates a new thread object, Thread-1, and starts the thread.
The main thread acquires the lock of the Thread-1 object.
The main thread invokes join on the Thread-1 object.
The source code for Thread.join is basically
with the understanding that the runtime system will invoke notifyAll when the thread actually terminates.
Since the join method is synchronized, when the main thread invokes join() on the Thread-1 object,
the main thread would acquire the lock of the Thread-1 object, but it already has the lock!
The main thread invokes wait(0) on "this", the Thread-1 object (at line 6),
the main thread is added to the wait set of the Thread-1 object,
and the main thread releases the lock of the Thread-1 object.
[ July 11, 2003: Message edited by: Marlene Miller ]