]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/pthread_mutex_consistent.3
man*/: srcfix (Use .P instead of .PP or .LP)
[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 3.\"
5fbde956 4.\" SPDX-License-Identifier: Linux-man-pages-copyleft
6d793426 5.\"
4c1c5274 6.TH pthread_mutex_consistent 3 (date) "Linux man-pages (unreleased)"
6d793426 7.SH NAME
fcc827bc 8pthread_mutex_consistent \- make a robust mutex consistent
223a8142
AC
9.SH LIBRARY
10POSIX threads library
8fc3b2cf 11.RI ( libpthread ", " \-lpthread )
6d793426
YR
12.SH SYNOPSIS
13.nf
14.B #include <pthread.h>
c6d039a3 15.P
fcc827bc 16.BI "int pthread_mutex_consistent(pthread_mutex_t *" mutex ");"
6d793426 17.fi
c6d039a3 18.P
d39ad78f 19.RS -4
abdad185
MK
20Feature Test Macro Requirements for glibc (see
21.BR feature_test_macros (7)):
d39ad78f 22.RE
c6d039a3 23.P
abdad185 24.BR pthread_mutex_consistent ():
9d2adbae
MK
25.nf
26 _POSIX_C_SOURCE >= 200809L
27.fi
6d793426 28.SH DESCRIPTION
a9e45d24 29This function makes a robust mutex consistent if it is in an inconsistent
da9fc029 30state.
a9e45d24 31A mutex can be left in an inconsistent state if its owner terminates
fcc827bc 32while holding the mutex, in which case the next owner who acquires the
2fe9fbf1 33mutex will succeed and be notified by a return value of
1ae6b2c7 34.B EOWNERDEAD
2fe9fbf1
MK
35from a call to
36.BR pthread_mutex_lock ().
6d793426
YR
37.SH RETURN VALUE
38On success,
a9163c20 39.IR pthread_mutex_consistent ()
da9fc029 40returns 0.
a126d040 41Otherwise,
855d489a 42it returns a positive error number to indicate the error.
6d793426
YR
43.SH ERRORS
44.TP
45.B EINVAL
a9e45d24 46The mutex is either not robust or is not in an inconsistent state.
3113c7f3 47.SH STANDARDS
abdad185 48POSIX.1-2008.
4131356c
AC
49.SH HISTORY
50glibc 2.12.
51POSIX.1-2008.
c6d039a3 52.P
99fa587d
MK
53Before the addition of
54.BR pthread_mutex_consistent ()
55to POSIX,
56glibc defined the following equivalent nonstandard function if
1ae6b2c7 57.B _GNU_SOURCE
99fa587d 58was defined:
c6d039a3 59.P
99fa587d 60.nf
06b7507d 61.B [[deprecated]]
afcddad5 62.BI "int pthread_mutex_consistent_np(const pthread_mutex_t *" mutex );
99fa587d 63.fi
c6d039a3 64.P
99fa587d 65This GNU-specific API, which first appeared in glibc 2.4,
bda25734
MK
66is nowadays obsolete and should not be used in new programs;
67since glibc 2.34 it has been marked as deprecated.
4131356c
AC
68.SH NOTES
69.BR pthread_mutex_consistent ()
70simply informs the implementation that the state (shared data)
71guarded by the mutex has been restored to a consistent state and that
72normal operations can now be performed with the mutex.
73It is the application's responsibility to ensure that the
74shared data has been restored to a consistent state before calling
75.BR pthread_mutex_consistent ().
a14af333 76.SH EXAMPLES
f49ed5cd
MK
77See
78.BR pthread_mutexattr_setrobust (3).
6d793426
YR
79.SH SEE ALSO
80.ad l
81.nh
6d793426 82.BR pthread_mutex_lock (3),
6d793426 83.BR pthread_mutexattr_getrobust (3),
85a7ae73 84.BR pthread_mutexattr_init (3),
27f942ad 85.BR pthread_mutexattr_setrobust (3),
6d793426 86.BR pthreads (7)