| Author |
thread lock
|
ankur rathi
Ranch Hand
Joined: Oct 11, 2004
Posts: 3829
|
|
join() method doesn't return lock . synchronized public void m() { // some code t.start(); t.join(); // line2 // spme code } Suppose the thread which is executing m method has lock , In line 2 we are joining this thread to t , so it will wait untill t will do its work , at the time of waiting also it has lock ... right ?? thanks a lot .
|
 |
Henry Wong
author
Sheriff
Joined: Sep 28, 2004
Posts: 16811
|
|
join() will wait until the run() method of the t thread finishes. And it does not give up it's lock while waiting. Henry
|
Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
|
 |
 |
|
|
subject: thread lock
|
|
|