[Prev] [Contents] [Next]

pthread_rwlockattr_init()--Initialize Read/Write Lock Attribute

Syntax

#include <pthread.h>
int pthread_rwlockattr_init(pthread_rwlockattr_t *attr);
Threadsafe: Yes
Signal Safe: Yes

The pthread_rwlockattr_init() function initializes the read/write lock attributes object referenced 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.
Attribute Default value supported values
pshared PTHREAD_PROCESS_PRIVATE PTHREAD_PROCESS_PRIVATE or PTHREAD_PROCESS_SHARED

Parameters

attr
(Output) Address of the variable to contain the read/write lock attributes object.

Authorities and Locks

None.

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

Example

See the pthread_rwlockattr_destroy() example.




[Prev] [Contents] [Next]
Copyright © 1998, IBM Corporation. All rights reserved.
Comments? Contact
rchthrds@us.ibm.com