DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

pthread_mutexattr_init(PTHREAD)


pthread_mutexattr_init, pthread_mutexattr_destroy -- initialize, destroy mutex attributes object

Synopsis

   cc [options] -Kthread file
   

#include <pthread.h>

int pthread_mutexattr_init(pthread_mutexattr_t *attr); int pthread_mutexattr_destroy(pthread_mutexattr_t *attr);

Description

pthread_mutexattr_init initializes a mutex attributes object with the default values for all defined attributes: PTHREAD_PROCESS_PRIVATE and PTHREAD_MUTEX_DEFAULT.

pthread_mutexattr_destroy destroys a mutex attributes object. The object becomes, in effect, uninitialized.

attr is a pointer to a mutex attributes to be initialized or destroyed.

After a mutex attributes object has been used to initialize one or more mutexes, any function affecting the attributes object (including destruction) does not affect any previously initialized mutexes.

Return values

pthread_mutexattr_init and pthread_mutexattr_destroy return zero on success. Otherwise, an error number is returned.

Diagnostics

pthread_mutexattr_destroy returns the following values if the corresponding conditions are detected:


EINVAL
The value specified by attr is invalid.

Standards Compliance

The Single UNIX Specification, Version 2; The Open Group.

References

Intro(PTHREAD), pthread_create(PTHREAD), pthread_cond_init(PTHREAD), pthread_mutex_init(PTHREAD), pthread_mutexattr_getprotocol(PTHREAD), pthread_mutexattr_getpshared(PTHREAD), pthread_mutexattr_setprotocol(PTHREAD), pthread_mutexattr_setpshared(PTHREAD), pthread(F)
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 - 01 June 2005