int pthread_rwlock_destroy(pthread_rwlock_t *rwlock);
int pthread_rwlock_init(pthread_rwlock_t *restrict rwlock, const pthread_rwlockattr_t *restrict attr);
A read-write lock can be statically initialized by assigning PTHREAD_RWLOCK_INITIALIZER in its definition, as follows:
pthread_rwlock_t rwlock = PTHREAD_RWLOCK_INITIALIZER;
A read-write lock must be initialized (either
Only the object referenced by rwlock may be used for performing
synchronization. The result of referring to copies of that object in calls to
You can only use rwlock itself to perform synchronization.
Referring to copies of rwlock in calls to the
Points to an object specifying the attributes to assign to the read-write lock being initialized.
Points to a read-write lock to be initialized or destroyed.
On success, the
Insufficient resources (other than memory) exist to initialize another read-write lock.
You tried to destroy the object pointed to by rwlock while it was locked or held by another thread.
The rwlock or attr arguments specify an invalid value. For example, this may occur when you try to destroy an uninitialized read-write lock with
pthread_rwlock_destroy(), try to initialize an already initialized read-write lock with pthread_rwlock_init(), or try to use any read-lock lock without first initializing it.
Insufficient memory exists to initialize the read-write lock.
The caller lacks the required privilege to perform the operation.
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
pthread_rwlock_rdlock(), pthread_rwlock_timedrdlock(), pthread_rwlock_timedwrlock(), pthread_rwlock_tryrdlock(), pthread_rwlock_trywrlock(), pthread_rwlock_unlock(), pthread_rwlock_wrlock()
PTC MKS Toolkit 10.3 Documentation Build 39.