Join、CountDownLatch、cyclicBarrier、semaphore的用法与区别
JoinThreadt1=newThread(newrun());Threadt2=newThread(newrun());Threadt3=newThread(newrun());t1.join();t2.join();t3.join();System.out.println("allformerthreadisdead!!!!!")1.调用join()方法会阻塞当前线程,直到被调用线程死亡2.