What exactly does this method do? Is it used in connection with synchronization in some way? I'm uderstanding the use of this method in two ways:
1) Actually waits for a thread started before (Thread.start() is invoked on a thread before another thread) and executed when that thread is done executing.
2) Waits for an oppertunity to safely 'interrupt' the execution of the previous thread and begins executing for some interval of time.
Sorry if my wording is a bit confusing.
It allows a thread to wait untill another thread is done executing. So say you want a specific thread to always be the last thread executed when a program exits. You would have it call the join() method on all the other running threads, and it would then wait for them to finish.
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#join()
Basically, what Tuberload said, "Waits for the thread to die"
Quote from: iago on April 16, 2004, 06:49 AM
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#join()
Basically, what Tuberload said, "Waits for the thread to die"
Ah, never thought to point him to the documentation. :)
Quote from: Tuberload on April 16, 2004, 01:57 PM
Quote from: iago on April 16, 2004, 06:49 AM
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html#join()
Basically, what Tuberload said, "Waits for the thread to die"
Ah, never thought to point him to the documentation. :)
No need to point me there. I use the documentation whenever necessary, I read there first, but I found their description of the join() function a bit unclear.
Thanks for the replies iago and tuberload.