shutdown(): Initiates an orderly shutdown in which previously submitted tasks are executed, but no new tasks will be accepted.
boolean awaitTermination(long timeout, TimeUnit unit) Blocks until all tasks have completed execution after a shutdown request, or the timeout occurs, or the current thread is interrupted, whichever happens first.
boolean isShutdown() Returns true if this executor has been shut down.
boolean isTerminated() Returns true if all tasks have completed following shut down.
------解决方案-------------------- ExecutorService es = Executors.newFixedThreadPool(4); executor.invokeAll(tasks);