多线程编程指南

删除条件变量属性

使用 pthread_condattr_destroy(3C) 可以删除存储并使属性对象无效。

pthread_condattr_destroy 语法

int	pthread_condattr_destroy(pthread_condattr_t *cattr);
#include <pthread.h>

pthread_condattr_t cattr;

int ret;



/* destroy an attribute */

ret

 = pthread_condattr_destroy(&cattr); 

pthread_condattr_destroy 返回值

pthread_condattr_destroy() 在成功完成之后会返回零。其他任何返回值都表示出现了错误。如果出现以下情况,该函数将失败并返回对应的值。


EINVAL

描述:

cattr 指定的值无效。