Here you can find the source of normalShutdown(ExecutorService pool, int timeout, TimeUnit timeUnit)
public static void normalShutdown(ExecutorService pool, int timeout, TimeUnit timeUnit)
//package com.java2s; import java.util.concurrent.ExecutorService; import java.util.concurrent.TimeUnit; public class Main { public static void normalShutdown(ExecutorService pool, int timeout, TimeUnit timeUnit) { try {//ww w. jav a 2 s. co m pool.shutdownNow(); if (!pool.awaitTermination(timeout, timeUnit)) { System.err.println("Pool did not terminate"); } } catch (InterruptedException ie) { Thread.currentThread().interrupt(); } } }