PTHREAD_MUTEX_CONSISTENT(3)POSIX Programmer's ManualPTHREAD_MUTEX_CONSISTENT(3)



PPRROOLLOOGG
       This manual page is part of the POSIX Programmer's Manual.  The OS
       implementation of this interface may differ (consult the corresponding
       OS manual page for details of OS behavior), or the interface may not be
       implemented on OS.

NNAAMMEE
       pthread_mutex_consistent -- mark state protected by robust mutex as
       consistent

SSYYNNOOPPSSIISS
       #include <pthread.h>

       int pthread_mutex_consistent(pthread_mutex_t *_m_u_t_e_x);

DDEESSCCRRIIPPTTIIOONN
       If _m_u_t_e_x is a robust mutex in an inconsistent state, the
       _p_t_h_r_e_a_d___m_u_t_e_x___c_o_n_s_i_s_t_e_n_t() function can be used to mark the state
       protected by the mutex referenced by _m_u_t_e_x 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 [[EEOOWWNNEERRDDEEAADD]].
       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
       [[EEOOWWNNEERRDDEEAADD]] terminates before calling either
       _p_t_h_r_e_a_d___m_u_t_e_x___c_o_n_s_i_s_t_e_n_t() or _p_t_h_r_e_a_d___m_u_t_e_x___u_n_l_o_c_k(), the next thread
       that acquires the mutex lock shall be notified about the state of the
       mutex by the return value [[EEOOWWNNEERRDDEEAADD]].

       The behavior is undefined if the value specified by the _m_u_t_e_x argument
       to _p_t_h_r_e_a_d___m_u_t_e_x___c_o_n_s_i_s_t_e_n_t() does not refer to an initialized mutex.

RREETTUURRNN VVAALLUUEE
       Upon successful completion, the _p_t_h_r_e_a_d___m_u_t_e_x___c_o_n_s_i_s_t_e_n_t() function
       shall return zero. Otherwise, an error value shall be returned to
       indicate the error.

EERRRROORRSS
       The _p_t_h_r_e_a_d___m_u_t_e_x___c_o_n_s_i_s_t_e_n_t() function shall fail if:

       EEIINNVVAALL The mutex object referenced by _m_u_t_e_x is not robust or does not
              protect an inconsistent state.

       These functions shall not return an error code of [[EEIINNTTRR]].

       _T_h_e _f_o_l_l_o_w_i_n_g _s_e_c_t_i_o_n_s _a_r_e _i_n_f_o_r_m_a_t_i_v_e_.

EEXXAAMMPPLLEESS
       None.

AAPPPPLLIICCAATTIIOONN UUSSAAGGEE
       The _p_t_h_r_e_a_d___m_u_t_e_x___c_o_n_s_i_s_t_e_n_t() 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 _p_t_h_r_e_a_d___m_u_t_e_x___u_n_l_o_c_k() without a prior call
       to _p_t_h_r_e_a_d___m_u_t_e_x___c_o_n_s_i_s_t_e_n_t(), in which case subsequent threads that
       attempt to lock the mutex will fail to acquire the lock and be returned
       [[EENNOOTTRREECCOOVVEERRAABBLLEE]].

RRAATTIIOONNAALLEE
       If an implementation detects that the value specified by the _m_u_t_e_x
       argument to _p_t_h_r_e_a_d___m_u_t_e_x___c_o_n_s_i_s_t_e_n_t() does not refer to an initialized
       mutex, it is recommended that the function should fail and report an
       [[EEIINNVVAALL]] error.

FFUUTTUURREE DDIIRREECCTTIIOONNSS
       None.

SSEEEE AALLSSOO
       _p_t_h_r_e_a_d___m_u_t_e_x___l_o_c_k(), _p_t_h_r_e_a_d___m_u_t_e_x_a_t_t_r___g_e_t_r_o_b_u_s_t()

       The Base Definitions volume of POSIX.1-2017, <<pptthhrreeaadd..hh>>

CCOOPPYYRRIIGGHHTT
       Portions of this text are reprinted and reproduced in electronic form
       from IEEE Std 1003.1-2017, Standard for Information Technology --
       Portable Operating System Interface (POSIX), The Open Group Base
       Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the
       Institute of Electrical and Electronics Engineers, Inc and The Open
       Group.  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.opengroup.org/unix/online.html .

       Any typographical or formatting errors that appear in this page are
       most likely to have been introduced during the conversion of the source
       files to man page format. To report such errors, see
       https://www.kernel.org/doc/man-pages/reporting_bugs.html .



IEEE/The Open Group                  2017          PTHREAD_MUTEX_CONSISTENT(3)
