java线程池如何关闭

try {
            executorService.shutdown();
            while (!executorService.awaitTermination(1, TimeUnit.SECONDS)){
                Thread.sleep(1000);
            }
            log.info("所有线程均已结束");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

(全文完)

(转载本站文章请注明作者和出处 java线程池如何关闭