---
name: "pthread_condattr"
section: "3"
platform: "macos"
package: "libpthread"
version: "539.100.4"
release: "macOS 26.5"
platforms: ["freebsd", "macos"]
url: "https://new.carta.tech/pthread_condattr"
---

# pthread\_condattr(3)

condition attribute operations

## NAME

**pthread\_condattr\_init**, **pthread\_condattr\_destroy**, – condition attribute operations

## SYNOPSIS

**#include \<pthread.h\>**

*int*\

**pthread\_condattr\_init**(*pthread\_condattr\_t \*attr*);

*int*\

**pthread\_condattr\_destroy**(*pthread\_condattr\_t \*attr*);

## DESCRIPTION

Condition attribute objects are used to specify parameters to **pthread\_cond\_init**(). FreeBSD's implementation of conditions does not support any non-default attributes, so these functions are not very useful, though they are required to to be present by POSIX.

The **pthread\_condattr\_init**() function initializes a condition attribute object with the default attributes.

The **pthread\_condattr\_destroy**() function destroys a condition attribute object.

## RETURN VALUES

If successful, these functions return 0. Otherwise, an error number is returned to indicate the error.

## ERRORS

**pthread\_condattr\_destroy**() will fail if:

- \[EINVAL\]

  Invalid value for *attr*.

**pthread\_condattr\_init**() will fail if:

- \[ENOMEM\]

  Out of memory.

## SEE ALSO

[pthread\_cond\_init(3)](/pthread_cond_init/3.md)

## STANDARDS

The **pthread\_condattr\_init**() and **pthread\_condattr\_destroy**() functions conform to ISO/IEC 9945-1:1996 (“POSIX.1”)
