pthread_mutex_lock
时间: 2023-08-25 08:10:26 浏览: 98
pthread_mutex_lock是一个函数,用于获取一个互斥锁(mutex)。它会阻塞当前线程,直到成功获取到锁为止。\[2\]如果获取锁失败,可能是因为锁已经被其他线程占用,或者由于其他原因导致获取锁的操作失败。\[1\]与pthread_mutex_trylock相比,pthread_mutex_lock是一个阻塞函数,而pthread_mutex_trylock是一个非阻塞函数。\[3\]
#### 引用[.reference_title]
- *1* *3* [pthread_mutex_lock](https://blog.csdn.net/linking530/article/details/7896341)[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^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [关于pthread_mutex_lock使用](https://blog.csdn.net/z_muyangren/article/details/105398871)[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^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文