---
name: "pthread_rwlockattr_destroy"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd", "macos"]
url: "https://new.carta.tech/pthread_rwlockattr_destroy"
---

# pthread\_rwlockattr\_destroy(3)

destroy a read/write lock attributes object

## NAME

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

## LIBRARY

POSIX Threads Library (libpthread, -lpthread)

## 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 attributes 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.
