]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/pthread_mutex_consistent.3
proc.5: Note kernel version for /proc/PID/smaps VmFlags "wf" flag
[thirdparty/man-pages.git] / man3 / pthread_mutex_consistent.3
1 .\" Copyright (c) 2017, Yubin Ruan <ablacktshirt@gmail.com>
2 .\" and Copyright (c) 2017, Michael Kerrisk <mtk.manpages@gmail.com>
3 .\"
4 .\" %%%LICENSE_START(VERBATIM)
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date. The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein. The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\" %%%LICENSE_END
25 .\"
26 .TH PTHREAD_MUTEX_CONSISTENT 3 2019-10-10 "Linux" "Linux Programmer's Manual"
27 .SH NAME
28 pthread_mutex_consistent \- make a robust mutex consistent
29 .SH SYNOPSIS
30 .nf
31 .B #include <pthread.h>
32 .PP
33 .BI "int pthread_mutex_consistent(pthread_mutex_t *" mutex ");"
34 .fi
35 .PP
36 Compile and link with \fI\-pthread\fP.
37 .PP
38 .in -4n
39 Feature Test Macro Requirements for glibc (see
40 .BR feature_test_macros (7)):
41 .in
42 .PP
43 .BR pthread_mutex_consistent ():
44 .br
45 .RS 4
46 .ad l
47 _POSIX_C_SOURCE >= 200809L
48 .RE
49 .ad
50 .SH DESCRIPTION
51 This function makes a robust mutex consistent if it is in an inconsistent
52 state.
53 A mutex can be left in an inconsistent state if its owner terminates
54 while holding the mutex, in which case the next owner who acquires the
55 mutex will succeed and be notified by a return value of
56 .BR EOWNERDEAD
57 from a call to
58 .BR pthread_mutex_lock ().
59 .SH RETURN VALUE
60 On success,
61 .IR pthread_mutex_consistent ()
62 returns 0.
63 Otherwise,
64 it returns a positive error number to indicate the cause of the error.
65 .SH ERRORS
66 .TP
67 .B EINVAL
68 The mutex is either not robust or is not in an inconsistent state.
69 .SH VERSIONS
70 .BR pthread_mutex_consistent ()
71 was added to glibc in version 2.12.
72 .SH CONFORMING TO
73 POSIX.1-2008.
74 .SH NOTES
75 .BR pthread_mutex_consistent ()
76 simply informs the implementation that the state (shared data)
77 guarded by the mutex has been restored to a consistent state and that
78 normal operations can now be performed with the mutex.
79 It is the application's responsibility to ensure that the
80 shared data has been restored to a consistent state before calling
81 .BR pthread_mutex_consistent ().
82 .PP
83 Before the addition of
84 .BR pthread_mutex_consistent ()
85 to POSIX,
86 glibc defined the following equivalent nonstandard function if
87 .BR _GNU_SOURCE
88 was defined:
89 .PP
90 .nf
91 .BI "int pthread_mutex_consistent(const pthread_mutex_t *" mutex );
92 .fi
93 .PP
94 This GNU-specific API, which first appeared in glibc 2.4,
95 is nowadays obsolete and should not be used in new programs.
96 .SH EXAMPLE
97 See
98 .BR pthread_mutexattr_setrobust (3).
99 .SH SEE ALSO
100 .ad l
101 .nh
102 .BR pthread_mutex_lock (3),
103 .BR pthread_mutexattr_init (3),
104 .BR pthread_mutexattr_getrobust (3),
105 .BR pthread_mutexattr_setrobust (3),
106 .BR pthreads (7)