多线程同步工具CountdownLatch,CyclicBarrier,Exchanger,Semaphore
一、CountdownLatch允许一个或多个线程等待直到在其他线程中执行的一组操作完成。示例代码:publicclassCountdownLatchTest{publicstaticvoidmain(String[]args){ExecutorServiceservice=Executors.newCachedThreadPool();finalCountDownLatchcdOrder=new