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 re‐
29       turns a positive error number to indicate 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 mu‐
45       tex.  It is the application's responsibility to ensure that the  shared
46       data has been restored to a consistent state before calling pthread_mu‐
47       tex_consistent().
48
49       Before the addition of pthread_mutex_consistent() to POSIX,  glibc  de‐
50       fined  the following equivalent nonstandard function if _GNU_SOURCE was
51       defined:
52
53       int pthread_mutex_consistent_np(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; since glibc 2.34 it
57       has been marked as deprecated.
58

EXAMPLES

60       See pthread_mutexattr_setrobust(3).
61

SEE ALSO

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

COLOPHON

67       This page is part of release 5.13 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                             2021-08-27       PTHREAD_MUTEX_CONSISTENT(3)
Impressum