参考链接:http://www.cnblogs.com/dolphin0520/p/3932921.html
几个理解的key
- 线程池执行实现了Runnable的类,其实是反射调用该类实现的run()函数
- 线程池加载所有任务后,可以关闭(不能再添加新的线程任务),等待所有线程执行完后退出。使用以下代码实现
12executor.shutdown()executor.awaitTermination(7, TimeUnit.DAYS)
2015年10月20日Linux
参考链接:http://www.cnblogs.com/dolphin0520/p/3932921.html
几个理解的key
1 2 |
executor.shutdown() executor.awaitTermination(7, TimeUnit.DAYS) |