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