Recall that the parent threads in the Pthreads and Windows libraries
use pthread join() and WaitForSingleObject() (respectively) to wait
for the summation threads to finish before proceeding.
The join() method in Java provides similar functionality.
(Notice that join() can throw an InterruptedException, which we choose to ignore.)
If the parent must wait for several threads to finish, the join() method can be enclosed in a for loop similar to that shown for Pthreads in Figure 4.10