(String[] args)
| 11 | @Override public void run() { new Nap(1); } |
| 12 | } |
| 13 | public static void main(String[] args) { |
| 14 | ExecutorService exec = |
| 15 | Executors.newCachedThreadPool(); |
| 16 | int count = 0; |
| 17 | try { |
| 18 | while(true) { |
| 19 | exec.execute(new Dummy()); |
| 20 | count++; |
| 21 | } |
| 22 | } catch(Error e) { |
| 23 | System.out.println( |
| 24 | e.getClass().getSimpleName() + ": " + count); |
| 25 | System.exit(0); |
| 26 | } finally { |
| 27 | exec.shutdown(); |
| 28 | } |
| 29 | } |
| 30 | } |