pthread_mutexattr_init()

initialize mutex attribute object 

Function


SYNOPSIS

#include <pthread.h>

int pthread_mutexattr_init(pthread_mutexattr_t *attr);


DESCRIPTION

The pthread_mutexattr_init() function initializes a mutex attribute object with the default settings for each attribute, as follows:

Attribute Default Value Description
priority N/A Attribute not supported.
protocol N/A Attribute not supported.
pshared PTHREAD_PROCESS_PRIVATE Mutex is usable only within the current process.
type PTHREAD_MUTEX_DEFAULT Default mutex behavior.

A mutex attribute object must be initialized prior to calling any of the pthread_mutexattr_setXXX() functions.


PARAMETERS

attr 

Is the mutex attribute object to be initialized.


RETURN VALUES

On success, pthread_mutexattr_init() returns 0. On error, one of the following values is returned:

ENOMEM 

Insufficient memory exists to create the mutex attribute object.

EINVAL 

attr does not point to writable memory.

EFAULT 

attr is an invalid pointer.


CONFORMANCE

UNIX 98.


MULTITHREAD SAFETY LEVEL

MT-safe.


PORTING ISSUES

None.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
pthread_mutex_init(), pthread_mutexattr_destroy(), pthread_mutexattr_setprioceiling(), pthread_mutexattr_setprotocol(), pthread_mutexattr_setpshared(), pthread_mutexattr_settype()


PTC MKS Toolkit 10.4 Documentation Build 39.