February 2014
Beginner
1248 pages
62h 25m
English
After scheduling tasks to execute, you’ll typically want to wait for the tasks to complete—for example, so that you can use the tasks’ results. After calling method shutdown, you can call ExecutorService method awaitTermination to wait for scheduled tasks to complete. We demonstrate this in Fig. 23.7. We purposely did not call awaitTermination in Fig. 23.4 to demonstrate that a program can continue executing after the main thread terminates.
Read now
Unlock full access