]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/pthread_mutex_consistent.3
rename.2: SEE ALSO: add rename(1)
[thirdparty/man-pages.git] / man3 / pthread_mutex_consistent.3
CommitLineData
6d793426 1.\" Copyright (c) 2017, Yubin Ruan <ablacktshirt@gmail.com>
f49ed5cd 2.\" and Copyright (c) 2017, Michael Kerrisk <mtk.manpages@gmail.com>
6d793426
YR
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.\"
867c9b34 26.TH PTHREAD_MUTEX_CONSISTENT 3 2019-10-10 "Linux" "Linux Programmer's Manual"
6d793426 27.SH NAME
fcc827bc 28pthread_mutex_consistent \- make a robust mutex consistent
6d793426
YR
29.SH SYNOPSIS
30.nf
31.B #include <pthread.h>
32.PP
fcc827bc 33.BI "int pthread_mutex_consistent(pthread_mutex_t *" mutex ");"
6d793426
YR
34.fi
35.PP
36Compile and link with \fI\-pthread\fP.
abdad185
MK
37.PP
38.in -4n
39Feature 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
6d793426 50.SH DESCRIPTION
a9e45d24 51This function makes a robust mutex consistent if it is in an inconsistent
da9fc029 52state.
a9e45d24 53A mutex can be left in an inconsistent state if its owner terminates
fcc827bc 54while holding the mutex, in which case the next owner who acquires the
2fe9fbf1
MK
55mutex will succeed and be notified by a return value of
56.BR EOWNERDEAD
57from a call to
58.BR pthread_mutex_lock ().
6d793426
YR
59.SH RETURN VALUE
60On success,
a9163c20 61.IR pthread_mutex_consistent ()
da9fc029 62returns 0.
a126d040
MK
63Otherwise,
64it returns a positive error number to indicate the cause of the error.
6d793426
YR
65.SH ERRORS
66.TP
67.B EINVAL
a9e45d24 68The mutex is either not robust or is not in an inconsistent state.
5214dd20
MK
69.SH VERSIONS
70.BR pthread_mutex_consistent ()
71was added to glibc in version 2.12.
abdad185
MK
72.SH CONFORMING TO
73POSIX.1-2008.
99fa587d 74.SH NOTES
cf5744eb
MK
75.BR pthread_mutex_consistent ()
76simply informs the implementation that the state (shared data)
77guarded by the mutex has been restored to a consistent state and that
a126d040 78normal operations can now be performed with the mutex.
cf5744eb
MK
79It is the application's responsibility to ensure that the
80shared data has been restored to a consistent state before calling
81.BR pthread_mutex_consistent ().
82.PP
99fa587d
MK
83Before the addition of
84.BR pthread_mutex_consistent ()
85to POSIX,
86glibc defined the following equivalent nonstandard function if
87.BR _GNU_SOURCE
88was defined:
89.PP
90.nf
91.BI "int pthread_mutex_consistent(const pthread_mutex_t *" mutex );
92.fi
93.PP
94This GNU-specific API, which first appeared in glibc 2.4,
95is nowadays obsolete and should not be used in new programs.
f49ed5cd
MK
96.SH EXAMPLE
97See
98.BR pthread_mutexattr_setrobust (3).
6d793426
YR
99.SH SEE ALSO
100.ad l
101.nh
6d793426 102.BR pthread_mutex_lock (3),
c8fb1c6d 103.BR pthread_mutexattr_init (3),
6d793426 104.BR pthread_mutexattr_getrobust (3),
27f942ad 105.BR pthread_mutexattr_setrobust (3),
6d793426 106.BR pthreads (7)