Limit shutdown time

Report a typo

Replace TODO with an expression that allows waiting for the execution to be completed for 5 milliseconds.

ExecutorService executor = Executors.newFixedThreadPool(2);
// submitting tasks

executor.shutdown();
// TODO
Enter a short text
___

Create a free account to access the full topic