Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Java Threads help !!!

Status
Not open for further replies.

poolboy

MIS
Jan 25, 2002
44
GB
I'm a bit confused on join() in threads. I know what it does but it is the actual implemetation that's got me confused..I know it pauses the current thread to let the thread on which join() is called terminates...
so for example if I have threadA and threadB...

could you pleease provide a very simple line of code to show how to apply join() if threadA were to wait for threadB to finish !!

Regards
poolboy
 
threadA were to wait for threadB to finish

In thread A, include the following line

threadB.join();

This will make thread A wait for thread B to finish before terminating itself

K. Mahesh


Have a nice day,
K. Mahesh

kay.mahesh@lycos.com

+91-124-6325025
 
Kmahesh,
thank you very much..you have been helpful

Regards
poolboy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top