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

# pthread\_rwlockattr\_destroy(3)

destroy a read/write lock

## NAME

**pthread\_rwlockattr\_destroy** – destroy a read/write lock

## SYNOPSIS

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

*int*\

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

## DESCRIPTION

The **pthread\_rwlockattr\_destroy**() function is used to destroy a read/write lock attribute object previously created with **pthread\_rwlockattr\_init**().

## RETURN VALUES

If successful, the **pthread\_rwlockattr\_destroy**() function will return zero. Otherwise an error number will be returned to indicate the error.

## ERRORS

The **pthread\_rwlockattr\_destroy**() function may fail if:

- \[EINVAL\]

  The value specified by *attr* is invalid.

## SEE ALSO

[pthread\_rwlockattr\_init(3)](/pthread_rwlockattr_init/3.md)

## STANDARDS

The **pthread\_rwlockattr\_destroy**() function is expected to conform to Version 2 of the Single UNIX Specification (“SUSv2”).

## HISTORY

The **pthread\_rwlockattr\_destroy**() function first appeared in FreeBSD 3.0.
