Standards / Extensions | C or C++ | Dependencies |
---|---|---|
z/OS UNIX |
both | POSIX(ON) |
#define _OPEN_THREADS
#include <pthread.h>
int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *attr, int pshared);
#define _UNIX03_THREADS
#include <pthread.h>
int pthread_rwlockattr_setpshared(pthread_rwlockattr_t *attr, int pshared);
The pthread_rwlockattr_setpshared() function sets the attribute pshared for the read or write lock attribute object attr.
A read or write lock attribute object allows you to manage the characteristics of read or write locks in your application. It defines the set of values to be used for a read or write lock during its creation. By establishing a read or write lock attribute object, you can create many read or write locks with the same set of characteristics, without needing to define those characteristics for each and every read or write lock. By using attr with the pthread_rwlockattr_setpshared() function you can define its process-shared value for a read or write lock.
If successful, pthread_rwlockattr_setpshared() returns 0.
Special behavior for Single UNIX Specification, Version 3: If unsuccessful, pthread_rwlockattr_setpshared() returns an error number to indicate the error.