OpenBSD manual page server

Manual Page Search Parameters

PTHREAD_MUTEXATTR_INIT(3) Library Functions Manual PTHREAD_MUTEXATTR_INIT(3)

pthread_mutexattr_init, pthread_mutexattr_destroy, pthread_mutexattr_setprioceiling, pthread_mutexattr_getprioceiling, pthread_mutexattr_setprotocol, pthread_mutexattr_getprotocol, pthread_mutexattr_settype, pthread_mutexattr_gettypemutex attribute operations

#include <pthread.h>

int
pthread_mutexattr_init(pthread_mutexattr_t *attr);

int
pthread_mutexattr_destroy(pthread_mutexattr_t *attr);

int
pthread_mutexattr_setprioceiling(pthread_mutexattr_t *attr, int prioceiling);

int
pthread_mutexattr_getprioceiling(pthread_mutexattr_t *attr, int *prioceiling);

int
pthread_mutexattr_setprotocol(pthread_mutexattr_t *attr, int protocol);

int
pthread_mutexattr_getprotocol(pthread_mutexattr_t *attr, int *protocol);

int
pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type);

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

Mutex attributes are used to specify parameters to (). One attribute object can be used in multiple calls to pthread_mutex_init(), with or without modifications between calls.

The () function initializes attr with all the default mutex attributes.

The () function destroys attr.

The () functions set the attribute that corresponds to each function name.

The () functions copy the value of the attribute that corresponds to each function name to the location pointed to by the second function parameter.

If successful, these functions return 0. Otherwise, an error number is returned to indicate the error.

pthread_mutexattr_init() will fail if:

[]
Out of memory.

pthread_mutexattr_destroy() will fail if:

[]
Invalid value for attr.

pthread_mutexattr_setprioceiling() will fail if:

[]
Invalid value for attr, or invalid value for prioceiling.

pthread_mutexattr_getprioceiling() will fail if:

[]
Invalid value for attr.

pthread_mutexattr_setprotocol() will fail if:

[]
Invalid value for attr, or invalid value for protocol.

pthread_mutexattr_getprotocol() will fail if:

[]
Invalid value for attr.

pthread_mutexattr_settype() will fail if:

[]
Invalid value for attr, or invalid value for type.

pthread_mutexattr_gettype() will fail if:

[]
Invalid value for attr.

pthread_mutex_init(3)

pthread_mutexattr_init() and pthread_mutexattr_destroy() conform to ISO/IEC 9945-1:1996 (“POSIX.1”)

pthread_mutexattr_setprioceiling(), pthread_mutexattr_getprioceiling(), pthread_mutexattr_setprotocol(), pthread_mutexattr_getprotocol(), pthread_mutexattr_settype(), and pthread_mutexattr_gettype() conform to Version 2 of the Single UNIX Specification (“SUSv2”)

November 10, 2015 OpenBSD-7.0