`
newslxw
  • 浏览: 216162 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

使用CountDownLatch,不再为判断多子线程什么时候完成而烦恼

 
阅读更多

 

每个子线程完成时 countDownLatch.countDown()

 

在主干线线程上countDownLatch.await()判断是否所有子线程已经完成,不再自己在InterruptedException异常中数数了,舒服多了

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics