DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

pthread_mutexattr_init(3pthread)


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(3pthread), pthread_create(3pthread), pthread_cond_init(3pthread), pthread_mutex_init(3pthread), pthread_mutexattr_getprotocol(3pthread), pthread_mutexattr_getpshared(3pthread), pthread_mutexattr_setprotocol(3pthread), pthread_mutexattr_setpshared(3pthread), pthread(4)
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004