60 lines
1.5 KiB
Plaintext
60 lines
1.5 KiB
Plaintext
'\"macro stdmacro
|
|
.TH pthread_rwlock_init 3P
|
|
.SH NAME
|
|
pthread_rwlock_init, pthread_rwlock_destroy \-
|
|
initialize/destroy a read-write lock object
|
|
.Op c p a
|
|
.SH C SYNOPSIS
|
|
.nf
|
|
.ft 3
|
|
#include <pthread.h>
|
|
.HP
|
|
.ft 3
|
|
int pthread_rwlock_init(pthread_rwlock_t \(**rwlock,
|
|
.br
|
|
pthread_rwlockattr_t \(**attr);
|
|
.HP
|
|
.ft 3
|
|
int pthread_rwlock_destroy(pthread_rwlock_t \(**rwlock);
|
|
.ft 1
|
|
.Op
|
|
.SH DESCRIPTION
|
|
Read-write locks may be initialized either dynamically, by calling
|
|
.IR pthread_rwlock_init (),
|
|
or statically, via the macro
|
|
.BR PTHREAD_RWLOCK_INITIALIZER .
|
|
.PP
|
|
The personality of the read-write lock is determined by the
|
|
attribute structure
|
|
.I attr
|
|
passed with the call to
|
|
.IR pthread_rwlock_init ().
|
|
These attributes are set by calls to
|
|
.IR pthread_rwlockattr_init ()
|
|
and the various pthread read-write lock attribute functions.
|
|
If
|
|
.I attr
|
|
is null (or the read-write lock is statically initialized),
|
|
the default attributes are used.
|
|
.PP
|
|
The routine
|
|
.IR pthread_rwlock_destroy ()
|
|
uninitializes the read-write lock object referenced by
|
|
.IR rwlock .
|
|
.SH "DIAGNOSTICS"
|
|
The read-write lock object functions return zero if successful;
|
|
otherwise, an error number is returned.
|
|
.PP
|
|
.IR pthread_rwlock_destroy ()
|
|
can return the following error:
|
|
.TP 15
|
|
.B [EBUSY]
|
|
The read-write lock is currently held by any thread.
|
|
.\" ---------------------
|
|
.SH "SEE ALSO"
|
|
pthread_rwlock_rdlock(3P),
|
|
pthread_rwlock_wrlock(3P),
|
|
pthread_rwlock_unlock(3P),
|
|
pthread_rwlockattr_init(3P),
|
|
pthread_rwlockattr_setpshared(3P).
|