PTHREAD_MUTEXATTR_GETROBUST(3C) | Standard C Library Functions | PTHREAD_MUTEXATTR_GETROBUST(3C) |
pthread_mutexattr_getrobust
,
pthread_mutexattr_setrobust
—
#include <pthread.h>
int
pthread_mutexattr_getrobust
(const
pthread_mutexattr_t *attr, int *robust);
int
pthread_mutexattr_setrobust
(pthread_mutexattr_t
*attr, int robust);
pthread_mutexattr_getrobust
() and
pthread_mtuexattr_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
.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.
pthread_mutexattr_getrobust
() function will fail if:
EINVAL
The pthread_mutexattr_setrobust
() function
will fail if:
EINVAL
August 20, 2019 | illumos |