2020
10-09
10-09
Java 判断线程池所有任务是否执行完毕的操作
我就废话不多说了,大家还是直接看代码吧~importjava.util.concurrent.ExecutorService;importjava.util.concurrent.Executors;publicclassTest{publicstaticvoidmain(Stringargs[])throwsInterruptedException{ExecutorServiceexe=Executors.newFixedThreadPool(3);for(inti=1;i<=5;i++){exe.execute(newSubThread(i));}exe.shutdown();while(true){if...
继续阅读 >