[Return to Bookshelf] [Contents] [Previous Section] [Next Section] [Index] [Help]


pthread_mutexattr_init

Initializes a mutex attributes object that is used to specify the attributes of mutexes when they are created.

Syntax

pthread_mutexattr_init(
                       attr );
 


Argument Data Type Access

attr opaque pthread_ write mutexattr_t


C Binding

#include 

int pthread_mutexattr_init ( pthread_mutexattr_t *attr);

Arguments

attr
Mutex attributes object to be initialized.

Description

This routine initializes a mutex attributes object (attr) used to specify the attributes of mutexes when they are created. The mutex attributes object is initialized with the default value for all of the attributes defined by DECthreads.

When a mutex attributes object is used to initialize a mutex, the values of the individual attributes determine the characteristics of the new object. Attributes objects act like additional arguments to object creation. Changing individual attributes or destroying the attributes object does not affect any objects that were previously created using the attributes object.

Return Values

If an error condition occurs, this routine returns an integer value indicating the type of error. Possible return values are as follows:
Return        Description

0 Successful completion. [ENOMEM] Insufficient memory while attempting to create the mutex attributes object.


Associated Routines

   pthread_create
   pthread_mutexattr_gettype_np
   pthread_mutexattr_settype_np
   pthread_mutex_init



[Return to Bookshelf] [Contents] [Previous Section] [Next Section] [Index] [Help]