CountDownLatch 可以复用吗
时间: 2023-10-19 13:36:04 浏览: 160
CountDownLatch是不可复用的,也就是说一旦计数器减到0,它的生命周期就结束了,不能再次使用。相反,CyclicBarrier可以复用,当所有线程都到达栅栏时,它的计数器会重置,可以被多次使用。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [CountDownLatch](https://blog.csdn.net/weixin_44130094/article/details/121879570)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* [CountDownLatch小述](https://blog.csdn.net/qq_33479841/article/details/120041471)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文