pthread_rwlockattr_init(3pthread)


pthread_rwlockattr_init -- initialize, destroy, read-write lock attributes object

Synopsis

   cc [options] -Kthread file
   

#include <pthread.h>

int pthread_rwlockattr_init(pthread_rwlockattr_t *attr); int pthread_rwlockattr_destroy(pthread_rwlockattr_t *attr);

Description

pthread_rwlockattr_init initializes a read-write lock attributes object attr with the default value PTHREAD_PROCESS_PRIVATE (see pthread_mutexattr_setpshared(3pthread) and pthread_mutexattr_setpshared(3pthread)).

After a read-write lock attributes object has been used to initialize one or more read-write locks, any function affecting the attributes object (including destruction) does not affect any previously initialized read-write locks.

pthread_rwlockattr_destroy destroys a read-write lock attributes object. The effect of subsequent use of the object is undefined until the object is re-initialized by another call to pthread_rwlockattr_init.

Return values

pthread_rwlockattr_init and pthread_rwlockattr_destroy return zero on success. Otherwise, an error number is returned.

Diagnostics

pthread_rwlockattr_init and pthread_rwlockattr_destroy return the following value if the corresponding condition is detected:

EINVAL
The value specified by attr is invalid.

References

Intro(3pthread), pthread(4), pthread_rwlockattr_getpshared(3pthread), pthread_rwlock_init(3pthread), pthread_rwlock_rdlock(3pthread), pthread_rwlock_unlock(3pthread), pthread_rwlock_wrlock(3pthread)
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004