Index of Section 2 Manual Pages
| Interix / SUA | pthread_rwlock_destroy.2 | Interix / SUA |
pthread_rwlock_destroy(2) pthread_rwlock_destroy(2)
pthread_rwlock_destroy()
NAME
pthread_rwlock_destroy(), pthread_rwlock_init() - initialize or destroy a
read-write lock object
SYNOPSIS
#include
int pthread_rwlock_destroy(pthread_rwlock_t *lock);
int pthread_rwlock_init(pthread_rwlock_t *lock,
const pthread_rwlockattr_t *attr);
DESCRIPTION
The pthread_rwlock_init(2) function initializes the read-write lock object
referenced by the lock argument using the attributes specified by the
read=-write lock attributes object referenced by the attr argument or, if
attr is null, using default attributes. Once initialized, the read-write
lock referenced by lock can be used multiple times without having to be
reinitialized.
The pthread_rwlock_destroy(2) function destroys the read-write lock object
referenced by the lock argument. A read-write lock object should not be
destroyed if any thread holds the lock.
RETURN VALUES
On success, both functions return 0; otherwise, an error code is returned.
ERRORS
The pthread_rwlock_destroy() function can fail for the following reasons:
[EBUSY]
The specified read-write lock object is in use.
[EINVAL]
The lock argument does not refer to a valid read-write lock object.
The pthread_rwlock_init() function can fail for the following reasons:
[EAGAIN]
The system does not have sufficient resources, other than memory, to
initialize the read-write lock object.
[EBUSY]
An attempt was made to reinitialize an existing read-write lock
object.
[EINVAL]
The lock argument does not refer to a valid read-write lock object.
[ENOMEM]
Not enough free memory is available to initialize the read-write lock
object.
[EPERM]
The caller does not have the permissions required to perform the
operation.
Neither function returns [EINTR].
SEE ALSO
pthread_rwlock_rdlock()
pthread_rwlock_timedrdlock()
pthread_rwlock_timedwrlock()
pthread_rwlock_tryrdlock()
pthread_rwlock_trywrlock()
pthread_rwlock_unlock()
pthread_rwlock_wrlock()
pthread_rwlockattr_destroy(2)
USAGE NOTES
All of these functions are thread safe.
None of these functions are async-signal safe.