Page 1 of 1

About Question enthuware.ocpjp.v8.2.1567 :

Posted: Wed Jun 01, 2016 6:14 pm
by schchen2000
The thread object on which join() has to be called must be waiting for a lock.
This answer choice is wrong because of the phrase "must be waiting for a lock."

It could have been a correct answer without that phrase because the thread that calls join() has to pause until another thread finishes its run() method and POSSIBLY to combine the results.

Is that correct?

I noticed you use the word "pause" when you said

"The thread that calls the join() method, pauses until the other thread ends (i.e. finishes its run() method.) There is no need for any thread to hold any lock."

Is "pause" equivalent to saying the wait() method has been called at least "under the hood" to make that thread to pause, i.e. a thread that is on join() is also on wait() at least implicitly?

Is that a reasonable thing to say?

Thanks.

Schmichael

Re: About Question enthuware.ocpjp.v8.2.1567 :

Posted: Wed Jun 01, 2016 7:29 pm
by admin
Yes to both.

Re: About Question enthuware.ocpjp.v8.2.1567 :

Posted: Wed Jun 01, 2016 10:42 pm
by schchen2000
admin wrote:Yes to both.
Thank you.

Schmichael