About Question enthuware.ocpjp.v7.2.1567 :
Posted: Tue Jun 11, 2013 2:57 am
Explanation:
From this javadoc: http://docs.oracle.com/javase/7/docs/ap ... tml#join()
Are you sure about that?The thread that calls the join() method, pauses till the other thread ends (i.e. finishes its run() method.) There is no need for any thread to hold any lock
From this javadoc: http://docs.oracle.com/javase/7/docs/ap ... tml#join()
The_Nickpublic final void join(long millis,
int nanos)
throws InterruptedException
Waits at most millis milliseconds plus nanos nanoseconds for this thread to die.
This implementation uses a loop of this.wait calls conditioned on this.isAlive. As a thread terminates the this.notifyAll method is invoked. It is recommended that applications not use wait, notify, or notifyAll on Thread instances.