多线程信号量计数CountDownLatch
摘要:
定义通过这个类可以记录当前线程个数。全称import java.util.concurrent.CountDownLatch;实例主线程CountDownLatch threadSignal = new CountDownLatch(Common.PARTPOINT);for(int i=0; i < Common.PARTPOINT; i++){P2PointThread ppt = new P2PointThread(threadSignal, i); ppt.start();}try { logger.debug("开始等待"); threadSignal.aw 阅读全文
posted @ 2012-03-12 19:33 亭子 阅读(297) 评论(0) 推荐(0) 编辑