Standards / Extensions | C or C++ | Dependencies |
---|---|---|
z/OS UNIX |
both | POSIX(ON) |
#define _OPEN_THREADS
#include <pthread.h>
int pthread_rwlock_unlock(pthread_rwlock_t *rwlock);
#define _UNIX03_THREADS
#include <pthread.h>
int pthread_rwlock_unlock(pthread_rwlock_t *rwlock);
The pthread_rwlock_unlock() function releases a read or write lock object. If one or more threads are waiting to lock the rwlock, pthread_rwlock_unlock() causes one or more of these threads to return from the pthread_rwlock_rdlock() or the pthread_rwlock_wrlock() call with the read or write lock object acquired. If there are multiple threads blocked on rwlock for both read locks and write locks, z/OS® UNIX will give the read or write lock to the next waiting call whether it is a read or a write request even when there is a writer blocked waiting for the lock. If no threads are waiting for the rwlock, the rwlock unlocks with no current owner.
If successful, pthread_rwlock_unlock() returns 0.
Special behavior for Single UNIX Specification, Version 3: If unsuccessful, pthread_rwlock_unlock() returns an error number to indicate the error.