名称
pthread_cond_init -- 创建一个条件变量
提要
#include <pthread.h>
int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr);
描述
The pthread_cond_init() 函数使用由attr指定的属性来创建一个条件变量,若attr为NULL,则属性取默认值。
返回值
If successful, the pthread_cond_init() function
will return zero and put the new condition
variable id into cond,

本文详细介绍了BSD库函数pthread_cond_init,用于创建条件变量。该函数根据指定的属性(默认或自定义)初始化条件变量,并在成功时返回零。可能的错误包括无效参数、内存不足和系统资源限制。文中还提到了与其他pthread相关函数的交互,如pthread_cond_broadcast和pthread_cond_wait,遵循POSIX.1标准。
最低0.47元/天 解锁文章
805

被折叠的 条评论
为什么被折叠?



