unique_lock wait函数
时间: 2023-08-28 16:04:26 浏览: 94
unique_lock的wait函数有两种重载形式。第一种形式是void wait(std::unique_lock<std::mutex>& lock),这个函数将当前线程置为睡眠状态,并释放锁,让其他线程获取锁并占用CPU。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [C++11中lock_guard和unique_lock的特点和区别,condition_variable为何搭配unique_lock使用](https://blog.csdn.net/KingOfMyHeart/article/details/118076229)[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* *3* [condition_variable类的wait函数参数需unique_lock模板类型](https://blog.csdn.net/wangxinhe1018/article/details/117380437)[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 ]
阅读全文