join each of the threads it creates.

Note that you have to create them all first, because as soon as you
join one, your main thread will not continue until the thread it's
joined exits.