Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tpe.shutdown();
- try {
- if (!tpe.awaitTermination(1, TimeUnit.SECONDS)) {
- tpe.shutdownNow();
- if (!tpe.awaitTermination(1, TimeUnit.SECONDS))
- System.err.println("Thread pool did not finish");
- }
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
Advertisement
Add Comment
Please, Sign In to add comment