Go to the documentation of this file.
17 #ifndef PTHREAD_MUTEX_ATTR_H
18 #define PTHREAD_MUTEX_ATTR_H
45 #define PTHREAD_MUTEX_NORMAL 0
46 #define PTHREAD_MUTEX_RECURSIVE 1
47 #define PTHREAD_MUTEX_ERRORCHECK 2
48 #define PTHREAD_MUTEX_DEFAULT PTHREAD_MUTEX_NORMAL
63 #define PTHREAD_PRIO_NONE 0
64 #define PTHREAD_PRIO_INHERIT 1
81 #define PTHREAD_PRIO_PROTECT 2
82 #define PTHREAD_MUTEX_STALLED 0
83 #define PTHREAD_MUTEX_ROBUST 1
int pshared
Whether to share the mutex with child processes.
int pthread_mutexattr_setpshared(pthread_mutexattr_t *attr, int pshared)
Set whether to share the mutex with child processes.
int pthread_mutexattr_settype(pthread_mutexattr_t *attr, int kind)
Sets the type of the mutex to create.
int pthread_mutexattr_getprotocol(const pthread_mutexattr_t *attr, int *protocol)
Query the priority inheritance of the mutex to create.
int kind
Type of the mutex.
int pthread_mutexattr_setrobust(pthread_mutexattr_t *attr, int robustness)
Set whether the mutex to create should be robust.
int pthread_mutexattr_getrobust(const pthread_mutexattr_t *attr, int *robustness)
Query the attribute set whether to create a robut mutex.
This type is unused right now, and only exists for POSIX compatibility.
int pthread_mutexattr_getpshared(const pthread_mutexattr_t *attr, int *pshared)
Queries the attribute set whether to share the mutex with child processes.
int pthread_mutexattr_init(pthread_mutexattr_t *attr)
Initialize a pthread_mutexattr_t.
int pthread_mutexattr_gettype(const pthread_mutexattr_t *attr, int *kind)
Query the type of the mutex to create.
int pthread_mutexattr_destroy(pthread_mutexattr_t *attr)
Destroys a pthread_mutexattr_t.
int robustness
What to do if a thread terminates while it holds a mutex.
int pthread_mutexattr_setprotocol(pthread_mutexattr_t *attr, int protocol)
Sets the priority inheritance of the mutex to create.
int protocol
Priority inheritance of the mutex.