Multithreaded Programming Guide

Exit Print View

Updated: July 2014
 
 

Getting the Mutex Type Attribute

pthread_mutexattr_gettype(3C) gets the mutex type attribute set by pthread_mutexattr_settype().

pthread_mutexattr_gettype Syntax

#include <pthread.h>

int pthread_mutexattr_gettype(pthread_mutexattr_t  *restrict attr , 
int  *restrict type);

The default value of the type attribute is PTHREAD_MUTEX_DEFAULT.

The type argument specifies the type of mutex. Valid mutex types include

  • PTHREAD_MUTEX_NORMAL

  • PTHREAD_MUTEX_ERRORCHECK

  • PTHREAD_MUTEX_RECURSIVE

  • PTHREAD_MUTEX_DEFAULT

For a description of each type, see pthread_mutexattr_settype Syntax.

pthread_mutexattr_gettype Return Values

On successful completion, pthread_mutexattr_gettype() returns 0. Any other return value indicates that an error occurred.

EINVAL

Description: The value specified by type is invalid.