pthread_rwlock_init, pthread_rwlock_destroy - initialize/destroy a readwrite
int pthread_rwlock_init(pthread_rwlock_t *rwlock,
int pthread_rwlock_destroy(pthread_rwlock_t *rwlock);
Read-write locks may be initialized either dynamically, by calling
pthread_rwlock_init(), or statically, via the macro
The personality of the read-write lock is determined by the attribute
structure attr passed with the call to pthread_rwlock_init(). These
attributes are set by calls to pthread_rwlockattr_init() and the various
pthread read-write lock attribute functions. If attr is null (or the
read-write lock is statically initialized), the default attributes are
The routine pthread_rwlock_destroy() uninitializes the read-write lock
object referenced by rwlock.
The read-write lock object functions return zero if successful;
otherwise, an error number is returned.
pthread_rwlock_destroy() can return the following error:
[EBUSY] The read-write lock is currently held by any thread.
PPPPaaaaggggeeee 1111 [ Back ]