1PTHREAD_MUTEX_CONSISTENT(3P)POSIX Programmer's ManuaPlTHREAD_MUTEX_CONSISTENT(3P)
2
3
4

PROLOG

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

NAME

12       pthread_mutex_consistent — mark state protected by robust mutex as con‐
13       sistent
14

SYNOPSIS

16       #include <pthread.h>
17
18       int pthread_mutex_consistent(pthread_mutex_t *mutex);
19

DESCRIPTION

21       If   mutex   is   a   robust   mutex  in  an  inconsistent  state,  the
22       pthread_mutex_consistent() function can be used to mark the state  pro‐
23       tected by the mutex referenced by mutex as consistent again.
24
25       If  an  owner of a robust mutex terminates while holding the mutex, the
26       mutex becomes inconsistent and the next thread that acquires the  mutex
27       lock  shall  be notified of the state by the return value [EOWNERDEAD].
28       In this case, the mutex does not become normally usable again until the
29       state is marked consistent.
30
31       If  the  thread  which  acquired  the  mutex lock with the return value
32       [EOWNERDEAD] terminates  before  calling  either  pthread_mutex_consis‐
33       tent()  or  pthread_mutex_unlock(),  the  next thread that acquires the
34       mutex lock shall be notified about the state of the mutex by the return
35       value [EOWNERDEAD].
36
37       The  behavior is undefined if the value specified by the mutex argument
38       to pthread_mutex_consistent() does not refer to an initialized mutex.
39

RETURN VALUE

41       Upon successful  completion,  the  pthread_mutex_consistent()  function
42       shall return zero. Otherwise, an error value shall be returned to indi‐
43       cate the error.
44

ERRORS

46       The pthread_mutex_consistent() function shall fail if:
47
48       EINVAL The mutex object referenced by mutex is not robust or  does  not
49              protect an inconsistent state.
50
51       These functions shall not return an error code of [EINTR].
52
53       The following sections are informative.
54

EXAMPLES

56       None.
57

APPLICATION USAGE

59       The pthread_mutex_consistent() function is only responsible for notify‐
60       ing the implementation that the state protected by the mutex  has  been
61       recovered  and that normal operations with the mutex can be resumed. It
62       is the responsibility of the application to recover the state so it can
63       be  reused.  If the application is not able to perform the recovery, it
64       can notify the implementation that the situation is unrecoverable by  a
65       call    to    pthread_mutex_unlock()    without   a   prior   call   to
66       pthread_mutex_consistent(),  in  which  case  subsequent  threads  that
67       attempt to lock the mutex will fail to acquire the lock and be returned
68       [ENOTRECOVERABLE].
69

RATIONALE

71       If an implementation detects that the  value  specified  by  the  mutex
72       argument to pthread_mutex_consistent() does not refer to an initialized
73       mutex, it is recommended that the function should fail  and  report  an
74       [EINVAL] error.
75

FUTURE DIRECTIONS

77       None.
78

SEE ALSO

80       pthread_mutex_lock(), pthread_mutexattr_getrobust()
81
82       The Base Definitions volume of POSIX.1‐2017, <pthread.h>
83
85       Portions  of  this text are reprinted and reproduced in electronic form
86       from IEEE Std 1003.1-2017, Standard for Information Technology --  Por‐
87       table  Operating System Interface (POSIX), The Open Group Base Specifi‐
88       cations Issue 7, 2018 Edition, Copyright (C) 2018 by the  Institute  of
89       Electrical  and  Electronics Engineers, Inc and The Open Group.  In the
90       event of any discrepancy between this version and the original IEEE and
91       The  Open Group Standard, the original IEEE and The Open Group Standard
92       is the referee document. The original Standard can be  obtained  online
93       at http://www.opengroup.org/unix/online.html .
94
95       Any  typographical  or  formatting  errors that appear in this page are
96       most likely to have been introduced during the conversion of the source
97       files  to  man page format. To report such errors, see https://www.ker
98       nel.org/doc/man-pages/reporting_bugs.html .
99
100
101
102IEEE/The Open Group                  2017         PTHREAD_MUTEX_CONSISTENT(3P)
Impressum