man.bsd.lv manual page server

Manual Page Search Parameters

PTHREAD_MUTEXATTR(3) Library Functions Manual PTHREAD_MUTEXATTR(3)

pthread_mutexattr_init, pthread_mutexattr_destroy, pthread_mutexattr_setprioceiling, pthread_mutexattr_getprioceiling, pthread_mutexattr_setprotocol, pthread_mutexattr_getprotocol, pthread_mutexattr_settype, pthread_mutexattr_gettype, pthread_mutexattr_getpshared, pthread_mutexattr_setpsharedmutex attribute operations

library “libpthread”

#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(const pthread_mutexattr_t * restrict attr, int * restrict prioceiling);

int
pthread_mutexattr_setprotocol(pthread_mutexattr_t *attr, int protocol);

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

int
pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type);

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

int
pthread_mutexattr_setpshared(pthread_mutexattr_t *attr, int pshared);

int
pthread_mutexattr_getpshared(const pthread_mutexattr_t * restrict attr, int * restrict pshared);

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. Note that the () function only supports PTHREAD_PROCESS_PRIVATE at the moment.

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.

The pthread_mutexattr_init() function will fail if:

[]
Out of memory.

The pthread_mutexattr_destroy() function will fail if:

[]
Invalid value for attr.

The pthread_mutexattr_setprioceiling() function will fail if:

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

The pthread_mutexattr_getprioceiling() function will fail if:

[]
Invalid value for attr.

The pthread_mutexattr_setprotocol() function will fail if:

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

The pthread_mutexattr_getprotocol() function will fail if:

[]
Invalid value for attr.

The pthread_mutexattr_getpshared() and pthread_mutexattr_setpshared() functions will fail if:

[]
The value specified by attr is invalid.

The pthread_mutexattr_settype() function will fail if:

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

The pthread_mutexattr_gettype() function will fail if:

[]
Invalid value for attr.

pthread_mutex_init(3)

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

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

March 3, 2018 DragonFly-5.6.1