pthread_mutex_consistent Subroutine
Purpose
Marks the protected state of a robust mutex as consistent.
Library
Threads Library (libpthreads.a)
Syntax
#include <pthread.h>
int pthread_mutex_consistent(pthread_mutex_t *mutex);
Description
The mutex object that is specified by the mutex parameter is marked as consistent by calling the pthread_mutex_consistent subroutine.
When a thread that holds a robust mutex terminates, the next thread that acquires the mutex is notified about the termination by the EOWNERDEAD error code. The mutex is marked as inconsistent and a call to the pthread_mutex_consistent subroutine marks the protected state of the robust mutex as consistent.
When a thread that holds a robust mutex terminates when it is in an inconsistent state, the next thread that acquires the mutex is notified about the termination. The robust mutex remains in an inconsistent state. If the pthread_mutex_consistent subroutine fails, the state of the robust mutex is not changed.
Parameters
Item | Description |
---|---|
mutex | Specifies the mutex object that must be marked as consistent. |
Return Values
On successful completion, the pthread_mutex_consistent subroutine returns a value of zero (0). Otherwise, an error code is returned to indicate the error.
Error Codes
The pthread_mutex_consistent subroutine can fail because of the following error:
Item | Description |
---|---|
EINVAL | The mutex object that is specified by the mutex parameter is not an initialized mutex object, or is not robust, or does not protect an inconsistent state. |
The pthread_mutex_consistent subroutine does not return the EINTR error code.