tail head cat sleep
QR code linking to this page

Manual Pages  — PTHREAD_MUTEXATTR

NAME

pthread_mutexattr_init, pthread_mutexattr_destroy, pthread_mutexattr_setprioceiling, pthread_mutexattr_getprioceiling, pthread_mutexattr_setprotocol, pthread_mutexattr_getprotocol, pthread_mutexattr_setrobust, pthread_mutexattr_getrobust, pthread_mutexattr_settype, pthread_mutexattr_gettype – mutex attribute operations

CONTENTS

LIBRARY

POSIX Threads Library (libpthread, -lpthread)

SYNOPSIS

#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_setrobust(pthread_mutexattr_t *attr, int robust);

int
pthread_mutexattr_getrobust(pthread_mutexattr_t *attr, int *robust);

int
pthread_mutexattr_settype(pthread_mutexattr_t *attr, int type);

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

DESCRIPTION

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

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

The pthread_mutexattr_destroy() function destroys attr.

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

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

RETURN VALUES

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

ERRORS

The pthread_mutexattr_init() function will fail if:
[ENOMEM]
  Out of memory.

The pthread_mutexattr_destroy() function will fail if:
[EINVAL]
  Invalid value for attr.

The pthread_mutexattr_setprioceiling() function will fail if:
[EINVAL]
  Invalid value for attr, or invalid value for prioceiling.

The pthread_mutexattr_getprioceiling() function will fail if:
[EINVAL]
  Invalid value for attr.

The pthread_mutexattr_setprotocol() function will fail if:
[EINVAL]
  Invalid value for attr, or invalid value for protocol.

The pthread_mutexattr_getprotocol() function will fail if:
[EINVAL]
  Invalid value for attr.

The pthread_mutexattr_settype() function will fail if:
[EINVAL]
  Invalid value for attr, or invalid value for type.

The pthread_mutexattr_gettype() function will fail if:
[EINVAL]
  Invalid value for attr.

The pthread_mutexattr_setrobust() function will fail if:
[EINVAL]
  Invalid value for attr, or invalid value for robust.

The pthread_mutexattr_getrobust() function will fail if:
[EINVAL]
  Invalid value for attr.

SEE ALSO

pthread_mutex_init(3)

STANDARDS

The pthread_mutexattr_init() and pthread_mutexattr_destroy() functions conform to IEEE Std 1003.1-96 ("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. The pthread_mutexattr_setrobust() and pthread_mutexattr_getrobust() functions conform to -susv4.


PTHREAD_MUTEXATTR (3) April 29, 2016

tail head cat sleep
QR code linking to this page


Please direct any comments about this manual page service to Ben Bullock. Privacy policy.

I think Unix and snowflakes are the only two classes of objects in the universe in which no two instances ever match exactly.
— Noel Chiappa