Example-8
Example-8 shows how to wait for threads to terminate and also shows how termination information can be passed back.