DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

pthread_rwlockattr_init(PTHREAD)


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(PTHREAD) and pthread_mutexattr_setpshared(PTHREAD)).

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(PTHREAD), pthread(F), pthread_rwlockattr_getpshared(PTHREAD), pthread_rwlock_init(PTHREAD), pthread_rwlock_rdlock(PTHREAD), pthread_rwlock_unlock(PTHREAD), pthread_rwlock_wrlock(PTHREAD)
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 - 01 June 2005