|PTHREAD_MUTEX_CONSISTENT(3P)||POSIX Programmer's Manual||PTHREAD_MUTEX_CONSISTENT(3P)|
PROLOGThis manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.
NAMEpthread_mutex_consistent — mark state protected by robust mutex as consistent
int pthread_mutex_consistent(pthread_mutex_t * mutex);
DESCRIPTIONIf mutex is a robust mutex in an inconsistent state, the pthread_mutex_consistent() function can be used to mark the state protected by the mutex referenced by mutex as consistent again.
If an owner of a robust mutex terminates while holding the mutex, the mutex becomes inconsistent and the next thread that acquires the mutex lock shall be 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.
If the thread which acquired the mutex lock with the return value [EOWNERDEAD] terminates before calling either pthread_mutex_consistent() or pthread_mutex_unlock(), the next thread that acquires the mutex lock shall be notified about the state of the mutex by the return value [EOWNERDEAD].
The behavior is undefined if the value specified by the mutex argument to pthread_mutex_consistent() does not refer to an initialized mutex.
RETURN VALUEUpon successful completion, the pthread_mutex_consistent() function shall return zero. Otherwise, an error value shall be returned to indicate the error.
ERRORSThe pthread_mutex_consistent() function shall fail if:
- The mutex object referenced by mutex is not robust or does not protect an inconsistent state.
These functions shall not return an error code of [EINTR].
The following sections are informative.
APPLICATION USAGEThe pthread_mutex_consistent() function is only responsible for notifying the implementation that the state protected by the mutex has been recovered and that normal operations with the mutex can be resumed. It is the responsibility of the application to recover the state so it can be reused. If the application is not able to perform the recovery, it can notify the implementation that the situation is unrecoverable by a call to pthread_mutex_unlock() without a prior call to pthread_mutex_consistent(), in which case subsequent threads that attempt to lock the mutex will fail to acquire the lock and be returned [ENOTRECOVERABLE].
RATIONALEIf an implementation detects that the value specified by the mutex argument to pthread_mutex_consistent() does not refer to an initialized mutex, it is recommended that the function should fail and report an [EINVAL] error.
SEE ALSOpthread_mutex_lock(), pthread_mutexattr_getrobust()
The Base Definitions volume of POSIX.1‐2008, <pthread.h>
COPYRIGHTPortions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, Copyright (C) 2013 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. (This is POSIX.1-2008 with the 2013 Technical Corrigendum 1 applied.) In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.unix.org/online.html .
|2013||IEEE/The Open Group|