pthread_rwlockattr_destroy() — Destroy a read or write lock attribute object

Standards

Standards / Extensions C or C++ Dependencies

z/OS UNIX
Single UNIX Specification, Version 3

both

POSIX(ON)
OS/390 V2R7

Format

#define _OPEN_THREADS
#include <pthread.h>

int pthread_rwlockattr_destroy(pthread_rwlockattr_t *attr);
SUSV3:
#define _UNIX03_THREADS
#include <pthread.h>

int pthread_rwlockattr_destroy(pthread_rwlockattr_t *attr);

General description

The pthread_rwlockattr_destroy() function destroys an initialized rwlock attribute object.

After a read or write lock attributes object has been used to initialize one or more read or write locks any function affecting the attributes object (including destruction) does not affect any previously initialized read or write locks.

The pthread_rwlockattr_destroy() function destroys a read or write lock attributes object. Subsequent use of the object will cause an error until the object is reinitialized by another call to pthread_rwlockattr_init().

Returned value

If successful, pthread_rwlockattr_destroy() returns 0.

If unsuccessful, pthread_rwlockattr_destroy() returns -1 and sets errno to one of the following values:

Error Code
Description
EINVAL
The value specified for attr is not valid.

Special behavior for Single UNIX Specification, Version 3: If unsuccessful, pthread_rwlockattr_destroy() returns an error number to indicate the error.

Related information