How can one thread wait for another thread to die before it continues execution?

John Zukowski

The thread's join() method allows you to wait for another thread to finish execution.


Thread t1 = new Thread(runnable);
t1.start();
// do stuff
...
// wait for t1 to finish
t1.join()
0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact