man.bsd.lv manual page server

Manual Page Search Parameters

PTHREAD_MUTEX_CONSISTENT(3) Library Functions Manual PTHREAD_MUTEX_CONSISTENT(3)

pthread_mutex_consistentmark state protected by robust mutex as consistent

library “libpthread”

#include <pthread.h>

int
pthread_mutex_consistent(pthread_mutex_t *mutex);

If the thread owning a robust mutex terminates while holding the mutex, the mutex becomes inconsistent and the next thread that acquires the mutex lock is notified of the state by the return value EOWNERDEAD. In this case, the mutex does not become normally usable again until the state is marked consistent.

The (), when called with the mutex argument, which points to the initialized robust mutex in an inconsistent state, marks the by mutex as consistent again. The consequent unlock of the mutex, by either () or other methods, allows other contenders to lock the mutex.

If the mutex in the inconsistent state is not marked consistent by the call to () before unlock, further attempts to lock the mutex result in the ENOTRECOVERABLE condition reported by the locking functions.

If successful, pthread_mutex_consistent() will return zero, otherwise an error number will be returned to indicate the error.

The pthread_mutex_lock() function will fail if:

[]
The mutex pointed to by the mutex argument is not robust, or is not in the inconsistent state.

pthread_mutex_init(3), pthread_mutex_lock(3), pthread_mutex_unlock(3), pthread_mutexattr_setrobust(3)

The pthread_mutex_lock() function conforms to Version 4 of the Single UNIX Specification (“SUSv4”).

March 27, 2017 FreeBSD-12.0