RFR 8237858: PlainSocketImpl.socketAccept() handles EINTR incorrectly
Martin Buchholz
martinrb at google.com
Sat Jul 4 14:44:26 UTC 2020
On Fri, Jul 3, 2020 at 11:12 PM Alan Bateman <Alan.Bateman at oracle.com> wrote:
> - "service" isn't a great name for the Executor. Also you can make use
> of try-finally, e.g.
> ExecutorService executor = Executors.newFixedThreadPool(1);
> try { ... } finally { executor.shutdown(); }
If you want to do this structured-concurrency-style, you should wait
for all the threads you started to complete (they might block!).
shutdown is not enough - you also want awaitTermination.
We have a PoolCleaner utility in test/jdk/java/util/concurrent/tck/ to
help do this.
try (PoolCleaner cleaner = cleaner(p)) {
More information about the net-dev
mailing list