标签:out str integer pool list stack highlight dex cto
public static void main(String[] args) {
CyclicBarrier cyclicBarrier = new CyclicBarrier(2, () -> {
System.out.println("====");
});
List<Integer> list = IntStream.rangeClosed(1, 100).boxed().collect(Collectors.toList());
List<List<Integer>> partition = Lists.partition(list, 50);
ExecutorService executorService = Executors.newFixedThreadPool(4);
for (List<Integer> list1 : partition) {
executorService.submit(()->{
try {
Thread.sleep(2000);
cyclicBarrier.await();
} catch (InterruptedException e) {
e.printStackTrace();
} catch (BrokenBarrierException e) {
e.printStackTrace();
}
});
}
}
标签:out str integer pool list stack highlight dex cto
原文地址:https://www.cnblogs.com/juncaoit/p/13399313.html