List of utility methods to do Thread Executor Pool
ExecutorService | getThrealPool() get Threal Pool return threalPool;
|
ExecutorService | getTightThreadPool() get Tight Thread Pool return getTightThreadPool(1d);
|
void | normalShutdown(ExecutorService pool, int timeout, TimeUnit timeUnit) normal Shutdown try { pool.shutdownNow(); if (!pool.awaitTermination(timeout, timeUnit)) { System.err.println("Pool did not terminate"); } catch (InterruptedException ie) { Thread.currentThread().interrupt(); |
void | safeClose(ExecutorService pool) close the thread pool safely. if (pool != null) { pool.shutdown(); try { if (!pool.awaitTermination(60, TimeUnit.SECONDS)) { pool.shutdownNow(); } catch (InterruptedException ex) { |