主线程等待多个子线程结束
//主线程定义
public CountDownLatch m_threadSignal;
?
//主线程初始化
?m_threadSignal = new CountDownLatch(10);
?
//主线程等待
// wait for all started threads (rendevouz)
try {
m_threadSignal.await();
} catch (InterruptedException e) {
LOG.error("can't wait for threads", e);
}
?
//子线程中将总线程数减一
m_threadSignal.countDown();