Does awaitTermination in ExecutorService “happens-before” any code executed after it?
问题 Please, help to understand ExecutorService#awaitTermination(timeout) behaviour. I'm observing situation when I have in my code: private void shutdownAndAwaitTermination(ExecutorService threadPool){ threadPool.shutdown(); try { if (!threadPool.awaitTermination(threadPoolTimeout, TimeUnit.HOURS)){ threadPool.shutdownNow(); if (!threadPool.awaitTermination(60, TimeUnit.SECONDS)) { logger.warn("Pool did not terminate"); } } } catch (InterruptedException ie) { threadPool.shutdownNow(); Thread