pthread_rwlockattr_setpshared(3P) pthread_rwlockattr_setpshared(3P)
pthread_rwlockattr_setpshared, pthread_rwlockattr_getpshared - set/get a
read-write lock attribute object's process-shared attribute
#include <pthread.h>
int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *attr,
int pshared);
int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t *attr,
int *opshared);
These functions manipulate the initialized read-write lock attribute
object attr [see pthread_rwlockattr_init()].
The function pthread_rwlockattr_setpshared() sets the process-shared
attribute value of the read-write lock. The attribute value may be
PTHREAD_PROCESS_PRIVATE or PTHREAD_PROCESS_SHARED.
The function pthread_rwlockattr_getpshared() returns the process-shared
attribute value of attr via opshared. The default value is
PTHREAD_PROCESS_PRIVATE.
A read-write lock with a process-shared attribute of
PTHREAD_PROCESS_PRIVATE may only be operated on by threads created within
the same process as the thread which initialized the read-write lock.
A read-write lock with a process-shared attribute of
PTHREAD_PROCESS_SHARED may be operated on by any thread that has access
to the memory where the read-write lock is allocated, even if the readwrite
lock is allocated in memory that is shared by multiple processes.
The read-write lock attribute process-shared functions return zero on
success; otherwise, an error number is returned:
[EINVAL] The attribute value specified by pshared is invalid.
pthread_rwlock_rdlock(3P), pthread_rwlock_unlock(3P),
pthread_rwlock_wrlock(3P), pthread_rwlockattr_init(3P).
PPPPaaaaggggeeee 1111 [ Back ]
|