ThreadPoolManager threadPoolManager = ThreadPoolManager.newInstance(); if (list.size() > 0) { for (int i = 0; i < list.size(); i++) { threadPoolManager.addExecuteTask(new ThreadTask(i,list.get(i))); System.out.println("线程池中线程数目:" + threadPoolManager.getPoolSize() + ",队列中等待执行的任务数目:" + threadPoolManager.getQueue() + ",已执行玩别的任务数目:" + threadPoolManager.getCompletedTaskCount()); } }
线程池调用
最新推荐文章于 2024-04-10 01:54:09 发布