Originally posted by Cameron Park:
Can someone explain to me what exactly does join() do?
Say, you have a
thread a which spawns another thread
b to do some work (perform a calculation, load an image, or whatever). This thread has been coded to do its job and then terminate.
Sometime later
a needs to do something which relies on
b having completed its work. That is where you have thread
a execute
b.join(). The effect of this statement is that
a waits for
b to complete.
- Peter