Guest User

lab8 apd

a guest
Nov 12th, 2019
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.26 KB | None | 0 0
  1. tpe.shutdown();
  2.  
  3. try {
  4.     if (!tpe.awaitTermination(1, TimeUnit.SECONDS)) {
  5.         tpe.shutdownNow();
  6.         if (!tpe.awaitTermination(1, TimeUnit.SECONDS))
  7.             System.err.println("Thread pool did not finish");
  8.         }
  9. } catch (InterruptedException e) {
  10.     e.printStackTrace();
  11. }
Advertisement
Add Comment
Please, Sign In to add comment