PTHREAD_MUTEXATTR_GETROBUST(3C) | Standard C Library Functions | PTHREAD_MUTEXATTR_GETROBUST(3C) |
pthread_mutexattr_getrobust
,
pthread_mutexattr_setrobust
—
get and set the mutex robust attribute
#include
<pthread.h>
int
pthread_mutexattr_getrobust
(const
pthread_mutexattr_t *attr, int *robust);
int
pthread_mutexattr_setrobust
(pthread_mutexattr_t
*attr, int robust);
The
pthread_mutexattr_getrobust
()
and
pthread_mutexattr_setrobust
()
functions obtain and set a mutex's
robust
attribute, putting it in, or obtaining it from robust.
The valid values for robust include:
EOWNERDEAD
. This allows the new owner the chance
to fix the internal state and call
pthread_mutex_consistent(3C)
prior to unlocking the lock, allowing normal operation to proceed. Any
crashes while in this state cause the next owner to obtain
EOWNERDEAD
.Upon successful completion, the
pthread_mutexattr_getrobust
() function will return
0 and update robust with the current
value of the robust attribute. Upon successful completion, the
pthread_mutexattr_setrobust
() function will return
0 and update the robust property of the attributes pointed
to by attr to robust. If either
function fails, an error code will be returned to indicate the error. Valid
errors are defined below.
The pthread_mutexattr_getrobust
() function
will fail if:
EINVAL
The pthread_mutexattr_setrobust
() function
will fail if:
EINVAL
pthread_mutex_consistent(3C), pthread(3HEAD), libpthread(3LIB), attributes(7), mutex(7)
November 8, 2020 | OmniOS |