1PTHREAD_MUTEX_CONSISTENT(3)Linux Programmer's ManualPTHREAD_MUTEX_CONSISTENT(3)
2
3
4

NAME

6       pthread_mutex_consistent - make a robust mutex consistent
7

SYNOPSIS

9       #include <pthread.h>
10
11       int pthread_mutex_consistent(pthread_mutex_t *mutex);
12
13       Compile and link with -pthread.
14
15   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
16
17       pthread_mutex_consistent():
18           _POSIX_C_SOURCE >= 200809L
19

DESCRIPTION

21       This  function makes a robust mutex consistent if it is in an inconsis‐
22       tent state.  A mutex can be left in an inconsistent state if its  owner
23       terminates  while  holding  the mutex, in which case the next owner who
24       acquires the mutex will succeed and be notified by a  return  value  of
25       EOWNERDEAD from a call to pthread_mutex_lock().
26

RETURN VALUE

28       On   success,  pthread_mutex_consistent()  returns  0.   Otherwise,  it
29       returns a positive error number to indicate the cause of the error.
30

ERRORS

32       EINVAL The mutex is either not robust or  is  not  in  an  inconsistent
33              state.
34

VERSIONS

36       pthread_mutex_consistent() was added to glibc in version 2.12.
37

CONFORMING TO

39       POSIX.1-2008.
40

NOTES

42       pthread_mutex_consistent()  simply  informs the implementation that the
43       state (shared data) guarded by the mutex has been restored to a consis‐
44       tent  state  and  that  normal operations can now be performed with the
45       mutex.  It is the  application's  responsibility  to  ensure  that  the
46       shared  data  has  been  restored  to a consistent state before calling
47       pthread_mutex_consistent().
48
49       Before the  addition  of  pthread_mutex_consistent()  to  POSIX,  glibc
50       defined  the  following  equivalent nonstandard function if _GNU_SOURCE
51       was defined:
52
53       int pthread_mutex_consistent(const pthread_mutex_t *mutex);
54
55       This GNU-specific API, which first appeared in glibc 2.4,  is  nowadays
56       obsolete and should not be used in new programs.
57

EXAMPLES

59       See pthread_mutexattr_setrobust(3).
60

SEE ALSO

62       pthread_mutex_lock(3), pthread_mutexattr_init(3),
63       pthread_mutexattr_getrobust(3), pthread_mutexattr_setrobust(3),
64       pthreads(7)
65

COLOPHON

67       This page is part of release 5.07 of the Linux man-pages project.  A
68       description of the project, information about reporting bugs, and the
69       latest version of this page, can be found at
70       https://www.kernel.org/doc/man-pages/.
71
72
73
74Linux                             2020-06-09       PTHREAD_MUTEX_CONSISTENT(3)
Impressum