std::lock_guard<std::mutex>
时间: 2023-09-15 08:16:31 浏览: 175
std::lock_guard<std::mutex>是C++11中提供的一个类模板,用于管理互斥量的锁定和解锁操作。通过使用std::lock_guard,可以确保在任何情况下都会在作用域结束时自动释放互斥量。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [C++并发 互斥](https://blog.csdn.net/Jay_Xio/article/details/124744802)[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_1"}}] [.reference_item style="max-width: 50%"]
- *3* [std::mutex和std::lock_guard](https://blog.csdn.net/weixin_41440739/article/details/124447686)[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_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文