Forwarding Kasper's mail to the right list.
-------- Original Message -------- Subject: AutoCloseable blocking or not Date: Fri, 5 Oct 2012 11:42:35 +0200 From: Kasper Nielsen <kaspe...@gmail.com> To: nio-disc...@openjdk.java.net Hi, I have a question about the AutoCloseable interface. Since I cannot find any mention about how asynchronously closeable resources should be handled. Say I wanted juc.ThreadPoolExecutorService to implement AutoCloseable. When close() returned should the executor be in the shutdown phase or in the terminated phase? In other words should I implement close() like this (which I believe) public void close() { executor.shutdown(); executor.awaitTermination(Long.MAX_VALUE, TimeUnit.SECONDS); //ignore any interrupted exceptions } or like this public void close() { executor.shutdown(); } - Kasper