您现在的位置是:主页 > news > 做网站的升级人/seo技术分享免费咨询
做网站的升级人/seo技术分享免费咨询
admin2025/6/23 21:59:52【news】
简介做网站的升级人,seo技术分享免费咨询,马蹄室内设计论坛,批发电商做的好的网站public class Test { //CountLaunch demo 指定6个线程执行完后才能达到条件,继续向下进行// 处理文件的数量private static final int threadCount 6;public static void main(String[] args) throws InterruptedException {// 创建一个具有固定线程数量的线程池对…
做网站的升级人,seo技术分享免费咨询,马蹄室内设计论坛,批发电商做的好的网站public class Test { //CountLaunch demo 指定6个线程执行完后才能达到条件,继续向下进行// 处理文件的数量private static final int threadCount 6;public static void main(String[] args) throws InterruptedException {// 创建一个具有固定线程数量的线程池对…
public class Test { //CountLaunch demo 指定6个线程执行完后才能达到条件,继续向下进行// 处理文件的数量private static final int threadCount = 6;public static void main(String[] args) throws InterruptedException {// 创建一个具有固定线程数量的线程池对象(推荐使用构造方法创建)ExecutorService threadPool = Executors.newFixedThreadPool(10);final CountDownLatch countDownLatch = new CountDownLatch(threadCount);for (int i = 0; i < threadCount; i++) {final int threadnum = i;threadPool.execute(() -> {try {//处理文件的业务操作Thread.sleep(2);//......} catch (InterruptedException e) {e.printStackTrace();} finally {//表示一个文件已经被完成countDownLatch.countDown();}});}countDownLatch.await();threadPool.shutdown();System.out.println("finish");}
}