Get the robust attribute from a mutex attribute object
#include <pthread.h> int pthread_mutexattr_getrobust( const pthread_mutexattr_t *attr, int *robust );
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The pthread_mutexattr_getrobust() function gets the robust attribute from the mutex attribute object attr and stores it in robust. You can use pthread_mutexattr_setrobust() to set this attribute.
The valid values for the robust attribute are:
The notified thread can then attempt to mark the state protected by the mutex as consistent again by a call to pthread_mutex_consistent(). After a subsequent successful call to pthread_mutex_unlock(), the mutex lock is released and can be used normally by other threads.
If the mutex is unlocked without a call to pthread_mutex_consistent(), it remains in a permanently unusable state and all attempts to lock the mutex fail with the error ENOTRECOVERABLE. The only permissible operation on such a mutex is pthread_mutex_destroy().
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | Yes |
Thread | Yes |