摘要:
CyclicBarrier是所有线程都到了指定的个数,才开始执行下边的代码。 public class CyclicBarrierDemo { // private static String[] arr = {"小王","小张","小李","小赵","小丽","小陈","小孙","小郭","小吴" 阅读全文
摘要:
/** * CountDownLatch的两种使用场景: * 场景1:让多个线程等待 * 场景2:和让单个线程等待。 */ public class CountDownLatchDemo { public static void main(String[] args) throws Exceptio 阅读全文