Multithreaded Programming Guide

Exit Print View

Updated: July 2014
 
 

Getting the Mutex Attribute's Protocol

pthread_mutexattr_getprotocol(3C) gets the protocol attribute of a mutex attribute object.

pthread_mutexattr_getprotocol Syntax

#include <pthread.h> 
int pthread_mutexattr_getprotocol(const pthread_mutexattr_t *restrict attr, 
int *restrict protocol);

attr points to a mutex attribute object created by an earlier call to pthread_mutexattr_init().

protocol contains one of the following protocol attributes: PTHREAD_PRIO_NONE, PTHREAD_PRIO_INHERIT, or PTHREAD_PRIO_PROTECT which are defined by the header <pthread.h>.

pthread_mutexattr_getprotocol Return Values

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

If either of the following conditions occurs, pthread_mutexattr_getprotocol() might fail and return the corresponding value.

EINVAL

Description: The value specified by attr is NULL, or the value specified by attr or protocol is invalid.

EPERM

Description: The caller does not have the privilege to perform the operation.