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
11

NAME

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

SYNOPSIS

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

DESCRIPTION

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

RETURN VALUE

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

ERRORS

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

EXAMPLES

57       None.
58

APPLICATION USAGE

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

RATIONALE

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

FUTURE DIRECTIONS

78       None.
79

SEE ALSO

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