]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/man/man3/pthread_mutex_consistent.3
Merge libc++ trunk r351319, and resolve conflicts.
[FreeBSD/FreeBSD.git] / share / man / man3 / pthread_mutex_consistent.3
1 .\" Copyright (c) 2016 The FreeBSD Foundation, Inc.
2 .\" All rights reserved.
3 .\"
4 .\" This documentation was written by
5 .\" Konstantin Belousov <kib@FreeBSD.org> under sponsorship
6 .\" from the FreeBSD Foundation.
7 .\"
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions
10 .\" are met:
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\"    notice, this list of conditions and the following disclaimer.
13 .\" 2. Redistributions in binary form must reproduce the above copyright
14 .\"    notice, this list of conditions and the following disclaimer in the
15 .\"    documentation and/or other materials provided with the distribution.
16 .\"
17 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
18 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
21 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 .\" SUCH DAMAGE.
28 .\"
29 .\" $FreeBSD$
30 .\"
31 .Dd March 27, 2017
32 .Dt PTHREAD_MUTEX_CONSISTENT 3
33 .Os
34 .Sh NAME
35 .Nm pthread_mutex_consistent
36 .Nd mark state protected by robust mutex as consistent
37 .Sh LIBRARY
38 .Lb libpthread
39 .Sh SYNOPSIS
40 .In pthread.h
41 .Ft int
42 .Fn pthread_mutex_consistent "pthread_mutex_t *mutex"
43 .Sh DESCRIPTION
44 If the thread owning a robust mutex terminates while holding the
45 mutex, the mutex becomes inconsistent and the next thread that
46 acquires the mutex lock is notified of the state by the return value
47 .Er EOWNERDEAD .
48 In this case, the mutex does not become normally usable again until
49 the state is marked consistent.
50 .Pp
51 The
52 .Fn pthread_mutex_consistent ,
53 when called with the
54 .Fa mutex
55 argument, which points to the initialized robust mutex in an
56 inconsistent state, marks the by mutex as consistent again.
57 The consequent unlock of the mutex, by either
58 .Fn pthread_mutex_unlock
59 or other methods, allows other contenders to lock the mutex.
60 .Pp
61 If the mutex in the inconsistent state is not marked consistent
62 by the call to
63 .Fn pthread_mutex_consistent
64 before unlock,
65 further attempts to lock the
66 .Fa mutex
67 result in the
68 .Er ENOTRECOVERABLE
69 condition reported by the locking functions.
70 .Sh RETURN VALUES
71 If successful,
72 .Fn pthread_mutex_consistent
73 will return zero, otherwise an error number will be returned to
74 indicate the error.
75 .Sh ERRORS
76 The
77 .Fn pthread_mutex_lock
78 function will fail if:
79 .Bl -tag -width Er
80 .It Bq Er EINVAL
81 The mutex pointed to by the
82 .Fa mutex
83 argument is not robust, or is not in the inconsistent state.
84 .El
85 .Sh SEE ALSO
86 .Xr pthread_mutex_init 3 ,
87 .Xr pthread_mutex_lock 3 ,
88 .Xr pthread_mutex_unlock 3 ,
89 .Xr pthread_mutexattr_setrobust 3
90 .Sh STANDARDS
91 The
92 .Fn pthread_mutex_lock
93 function conforms to
94 .St -susv4 .