next up previous contents index
Next: 18.3.13 pthread_condattr_init: Initialize a Up: 18.3 POSIX Threads Reference Previous: 18.3.11 pthread_mutexattr_setprotocol: Set the

18.3.12 pthread_mutexattr_settype: Set the type attribute of a mutex attributes object

 

SYNOPSIS

#include <oskit/threads/pthread.h>

int pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type);

DESCRIPTION

Set the type in a previously initialized mutex attribute object. PTHREAD_MUTEX_NORMAL, PTHREAD_MUTEX_ERRORCHECK, and PTHREAD_MUTEX_DEFAULT are equivalent. PTHREAD_MUTEX_RECURSIVE allows a mutex to be recursively locked.

PARAMETERS

attr
A pointer to the pthread_mutexattr_t object representing the attributes for a mutex initialization.
type
One of PTHREAD_MUTEX_NORMAL, PTHREAD_MUTEX_ERRORCHECK, PTHREAD_MUTEX_DEFAULT, or PTHREAD_MUTEX_RECURSIVE.

RETURNS

Returns zero on success.

RELATED INFORMATION

pthread_mutex_init



University of Utah Flux Research Group