#include <pthread.h> int pthread_rwlock_destroy(pthread_rwlock_t *rwlock);Service Program Name: QP0WPTHR
The pthread_rwlock_destroy() function destroys the named read/write lock. The destroyed read/write lock can no longer be used.
If pthread_rwlock_destroy() is called on a read/write lock on a mutex that is locked by another thread for either reading or writing, the request fails with an EBUSY error.
If pthread_rwlock_destroy() is used by a thread when it owns the read/write lock, and other threads are waiting for the read/write lock to become available (with calls to pthread_rwlock_rdlock(), pthread_rwlock_wrlock(), pthread_rwlock_timedrdlock_np() or pthread_rwlock_timedwrlock_np() APIs), the read/write lock is destroyed safely, and the waiting threads wake up with the EDESTROYED error. Threads calling pthread_rwlock_tryrdlock() or pthread_rwlock_trywrlock() return with either the EBUSY or EINVAL error, depending on when they called those functions.
Once a read/write lock is created, it cannot be validly copied or moved to a new location.
None.
If pthread_rwlock_destroy() was not successful, the error condition returned usually indicates one of the following errors. Under some conditions, the value returned could indicate an error other than those listed here.
The value specified for the argument is not correct.
See Code disclaimer information for information pertaining to code examples.
See the pthread_rwlock_init() example.
Top | Pthread APIs | APIs by category |