2 .\" This file and its contents are supplied under the terms of the
3 .\" Common Development and Distribution License ("CDDL"), version 1.0.
4 .\" You may only use this file in accordance with the terms of version
7 .\" A full copy of the text of the CDDL should have accompanied this
8 .\" source. A copy of the CDDL is also available via the Internet at
9 .\" http://www.illumos.org/license/CDDL.
12 .\" Copyright (c) 2014, Joyent, Inc.
15 .Dt PTHREAD_MUTEX_CONSISTENT 3C
18 .Nm pthread_mutex_consistent
19 .Nd mark state protected by robust mutex as consistent
23 .Fo pthread_mutex_consistent
24 .Fa "pthread_mutex_t *mutex"
28 .Fn pthread_mutex_consistent
29 function is used to indicate that a robust lock that is in an
30 inconsistent state no longer is.
32 A robust lock enters into an inconsistent state when a process or thread
33 holding a robust lock exits, such as by calling
37 or crashes without unlocking the lock.
38 At that point, if another process or thread is currently in a call, or calls
39 .Xr pthread_mutex_lock 3C ,
40 it will obtain the lock; however, the error code
43 In such cases, that thread will own the lock and must check and clean up any
44 inconsistent state that is protected by the lock.
45 When finished, it must call
46 .Fn pthread_mutex_consistent
47 to indicate that it is in a consistent state again.
49 If a process or thread obtains a robust lock while it is in an
50 inconsistent state and it crashes or terminates before marking the lock
51 as consistent, the next process or thread that obtains the lock will
55 Upon successful completion, the
56 .Fn pthread_mutex_consistent
57 returns zero and marks
61 .Fn pthread_mutex_lock
64 returned until another process or thread exits without unlocking.
65 Upon failure, an error will be returned which corresponds to one of the errors
69 .Fn pthread_mutex_consistent
70 function will fail if:
74 is an uninitialized mutex, not a robust mutex, or not in an inconsistent
77 .Sh INTERFACE STABILITY
82 .Xr pthread_mutex_destroy 3C ,
83 .Xr pthread_mutex_init 3C ,
84 .Xr pthread_mutex_lock 3C ,
85 .Xr pthread_mutexattr_getrobust 3C ,