pthread_mutexattr
时间: 2023-09-11 19:10:30 浏览: 171
关于C语言多线程pthread库的相关函数说明
pthread_mutexattr是一个用于设置和获取互斥锁属性的结构体。在使用互斥锁之前,我们可以使用pthread_mutexattr_init函数来初始化这个结构体。然后,可以使用pthread_mutexattr_settype函数来设置互斥锁的类型,例如可以选择设置为PTHREAD_MUTEX_NORMAL、PTHREAD_MUTEX_ERRORCHECK、PTHREAD_MUTEX_RECURSIVE等类型。最后,使用pthread_mutexattr_destroy函数来销毁互斥锁属性。这些函数可以帮助我们创建和配置互斥锁,以满足不同的需求。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [pthread_mutexattr_t设置的相关函数及其说明](https://blog.csdn.net/zz460833359/article/details/120349956)[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%"]
- *3* [pthread mutexattr](https://blog.csdn.net/dengwo1109/article/details/102350710)[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 ]
阅读全文