/** * Awaits completion of all submitted tasks. * * After this call completes, the thread pool will be shut down. */ public void awaitUninterruptibly() { shutdown(); while (!isTerminated()) { try { awaitTermination(1, TimeUnit.DAYS); } catch (final InterruptedException e) { } } }