pthread_rwlockattr_init()--Initialize Read/Write Lock Attribute
Syntax:
#include <pthread.h> int pthread_rwlockattr_init(pthread_rwlockattr_t *attr);Service Program Name: QP0WPTHR
Default Public Authority: *USE
Threadsafe: Yes
Signal Safe: Yes
The pthread_rwlockattr_init() function initializes the read/write lock attributes object referred to by attr to the default attributes. The read/write lock attributes object can be used in a call to pthread_rwlock_init() to create a read/write lock.
Authorities and Locks
None.
Parameters
- attr
- (Output) Address of the variable to contain the read/write lock attributes object
Return Value
- 0
- pthread_rwlockattr_init() was successful.
- value
- pthread_rwlockattr_init() was not successful. value is set to indicate the error condition.
Error Conditions
If pthread_rwlockattr_init() was not successful, the error condition returned usually indicates one of the following errors. Under some conditions, the value returned could indicate an error other than those listed here.
- [EINVAL]
The value specified for the argument is not correct.
Related Information
- The <pthread.h> header file. See Header files for Pthread functions.
- pthread_rwlockattr_destroy()--Destroy Read/Write Lock Attribute
- pthread_rwlock_init()--Initialize Read/Write Lock
Example
See the pthread_rwlockattr_destroy() example.
API introduced: V4R3
[ Back to top | Pthread APIs | APIs by category ]