]>
Commit | Line | Data |
---|---|---|
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 | .\" | |
fcc827bc | 26 | .TH PTHREAD_MUTEX_CONSISTENT 3 2017-08-20 "Linux" "Linux Programmer's Manual" |
6d793426 | 27 | .SH NAME |
fcc827bc | 28 | pthread_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 | |
36 | Compile and link with \fI\-pthread\fP. | |
abdad185 MK |
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 | |
6d793426 | 50 | .SH DESCRIPTION |
a9e45d24 | 51 | This function makes a robust mutex consistent if it is in an inconsistent |
da9fc029 | 52 | state. |
a9e45d24 | 53 | A mutex can be left in an inconsistent state if its owner terminates |
fcc827bc | 54 | while holding the mutex, in which case the next owner who acquires the |
2fe9fbf1 MK |
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 (). | |
6d793426 YR |
59 | .SH RETURN VALUE |
60 | On success, | |
61 | .IR pthread_mutex_consistent() | |
da9fc029 | 62 | returns 0. |
a126d040 MK |
63 | Otherwise, |
64 | it returns a positive error number to indicate the cause of the error. | |
6d793426 YR |
65 | .SH ERRORS |
66 | .TP | |
67 | .B EINVAL | |
a9e45d24 | 68 | The mutex is either not robust or is not in an inconsistent state. |
5214dd20 MK |
69 | .SH VERSIONS |
70 | .BR pthread_mutex_consistent () | |
71 | was added to glibc in version 2.12. | |
abdad185 MK |
72 | .SH CONFORMING TO |
73 | POSIX.1-2008. | |
99fa587d | 74 | .SH NOTES |
cf5744eb MK |
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 | |
a126d040 | 78 | normal operations can now be performed with the mutex. |
cf5744eb MK |
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 | |
99fa587d MK |
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. | |
f49ed5cd MK |
96 | .SH EXAMPLE |
97 | See | |
98 | .BR pthread_mutexattr_setrobust (3). | |
6d793426 YR |
99 | .SH SEE ALSO |
100 | .ad l | |
101 | .nh | |
102 | .BR pthread_mutexattr_init (3), | |
103 | .BR pthread_mutex_lock (3), | |
104 | .BR pthread_mutexattr_setrobust (3), | |
105 | .BR pthread_mutexattr_getrobust (3), | |
106 | .BR pthreads (7) |