2017-09-11 12:50:12 +00:00
|
|
|
.\" Copyright (c) 2017, Yubin Ruan <ablacktshirt@gmail.com>
|
2017-09-12 13:24:28 +00:00
|
|
|
.\" and Copyright (c) 2017, Michael Kerrisk <mtk.manpages@gmail.com>
|
2017-09-11 12:50:12 +00:00
|
|
|
.\"
|
|
|
|
.\" %%%LICENSE_START(VERBATIM)
|
|
|
|
.\" Permission is granted to make and distribute verbatim copies of this
|
|
|
|
.\" manual provided the copyright notice and this permission notice are
|
|
|
|
.\" preserved on all copies.
|
|
|
|
.\"
|
|
|
|
.\" Permission is granted to copy and distribute modified versions of this
|
|
|
|
.\" manual under the conditions for verbatim copying, provided that the
|
|
|
|
.\" entire resulting derived work is distributed under the terms of a
|
|
|
|
.\" permission notice identical to this one.
|
|
|
|
.\"
|
|
|
|
.\" Since the Linux kernel and libraries are constantly changing, this
|
|
|
|
.\" manual page may be incorrect or out-of-date. The author(s) assume no
|
|
|
|
.\" responsibility for errors or omissions, or for damages resulting from
|
|
|
|
.\" the use of the information contained herein. The author(s) may not
|
|
|
|
.\" have taken the same level of care in the production of this manual,
|
|
|
|
.\" which is licensed free of charge, as they might when working
|
|
|
|
.\" professionally.
|
|
|
|
.\"
|
|
|
|
.\" Formatted or processed versions of this manual, if unaccompanied by
|
|
|
|
.\" the source, must acknowledge the copyright and authors of this work.
|
|
|
|
.\" %%%LICENSE_END
|
|
|
|
.\"
|
localedef.1, close.2, copy_file_range.2, execve.2, get_robust_list.2, getdomainname.2, gethostname.2, inotify_add_watch.2, io_submit.2, ioctl_fideduperange.2, kcmp.2, kill.2, mmap.2, move_pages.2, perf_event_open.2, ptrace.2, rt_sigqueueinfo.2, sched_setaffinity.2, sched_setparam.2, setns.2, sigaction.2, signalfd.2, statx.2, syscall.2, syscalls.2, uname.2, write.2, errno.3, fexecve.3, getauxval.3, printf.3, pthread_mutex_consistent.3, pthread_mutexattr_init.3, pthread_mutexattr_setrobust.3, pthread_setcancelstate.3, regex.3, strtok.3, strtol.3, ttyname.3, smartpqi.4, core.5, resolv.conf.5, man-pages.7, mq_overview.7, operator.7, pthreads.7, signal-safety.7, sysvipc.7: Update timestamp
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2019-10-10 20:28:39 +00:00
|
|
|
.TH PTHREAD_MUTEX_CONSISTENT 3 2019-10-10 "Linux" "Linux Programmer's Manual"
|
2017-09-11 12:50:12 +00:00
|
|
|
.SH NAME
|
2017-09-12 11:37:12 +00:00
|
|
|
pthread_mutex_consistent \- make a robust mutex consistent
|
2017-09-11 12:50:12 +00:00
|
|
|
.SH SYNOPSIS
|
|
|
|
.nf
|
|
|
|
.B #include <pthread.h>
|
|
|
|
.PP
|
2017-09-12 11:37:12 +00:00
|
|
|
.BI "int pthread_mutex_consistent(pthread_mutex_t *" mutex ");"
|
2017-09-11 12:50:12 +00:00
|
|
|
.fi
|
|
|
|
.PP
|
|
|
|
Compile and link with \fI\-pthread\fP.
|
2017-09-12 12:03:31 +00:00
|
|
|
.PP
|
|
|
|
.in -4n
|
|
|
|
Feature Test Macro Requirements for glibc (see
|
|
|
|
.BR feature_test_macros (7)):
|
|
|
|
.in
|
|
|
|
.PP
|
|
|
|
.BR pthread_mutex_consistent ():
|
|
|
|
.br
|
|
|
|
.RS 4
|
|
|
|
.ad l
|
|
|
|
_POSIX_C_SOURCE >= 200809L
|
|
|
|
.RE
|
|
|
|
.ad
|
2017-09-11 12:50:12 +00:00
|
|
|
.SH DESCRIPTION
|
2017-09-12 13:26:44 +00:00
|
|
|
This function makes a robust mutex consistent if it is in an inconsistent
|
2017-09-12 11:38:26 +00:00
|
|
|
state.
|
2017-09-12 13:26:44 +00:00
|
|
|
A mutex can be left in an inconsistent state if its owner terminates
|
2017-09-12 11:37:12 +00:00
|
|
|
while holding the mutex, in which case the next owner who acquires the
|
2017-09-12 13:27:34 +00:00
|
|
|
mutex will succeed and be notified by a return value of
|
|
|
|
.BR EOWNERDEAD
|
|
|
|
from a call to
|
|
|
|
.BR pthread_mutex_lock ().
|
2017-09-11 12:50:12 +00:00
|
|
|
.SH RETURN VALUE
|
|
|
|
On success,
|
2019-02-27 10:04:19 +00:00
|
|
|
.IR pthread_mutex_consistent ()
|
2017-09-12 11:38:26 +00:00
|
|
|
returns 0.
|
2017-09-13 14:38:11 +00:00
|
|
|
Otherwise,
|
|
|
|
it returns a positive error number to indicate the cause of the error.
|
2017-09-11 12:50:12 +00:00
|
|
|
.SH ERRORS
|
|
|
|
.TP
|
|
|
|
.B EINVAL
|
2017-09-12 13:26:44 +00:00
|
|
|
The mutex is either not robust or is not in an inconsistent state.
|
2017-09-12 12:04:40 +00:00
|
|
|
.SH VERSIONS
|
|
|
|
.BR pthread_mutex_consistent ()
|
|
|
|
was added to glibc in version 2.12.
|
2017-09-12 12:03:31 +00:00
|
|
|
.SH CONFORMING TO
|
|
|
|
POSIX.1-2008.
|
2017-09-12 13:12:28 +00:00
|
|
|
.SH NOTES
|
2017-09-13 12:52:01 +00:00
|
|
|
.BR pthread_mutex_consistent ()
|
|
|
|
simply informs the implementation that the state (shared data)
|
|
|
|
guarded by the mutex has been restored to a consistent state and that
|
2017-09-13 14:38:11 +00:00
|
|
|
normal operations can now be performed with the mutex.
|
2017-09-13 12:52:01 +00:00
|
|
|
It is the application's responsibility to ensure that the
|
|
|
|
shared data has been restored to a consistent state before calling
|
|
|
|
.BR pthread_mutex_consistent ().
|
|
|
|
.PP
|
2017-09-12 13:12:28 +00:00
|
|
|
Before the addition of
|
|
|
|
.BR pthread_mutex_consistent ()
|
|
|
|
to POSIX,
|
|
|
|
glibc defined the following equivalent nonstandard function if
|
|
|
|
.BR _GNU_SOURCE
|
|
|
|
was defined:
|
|
|
|
.PP
|
|
|
|
.nf
|
|
|
|
.BI "int pthread_mutex_consistent(const pthread_mutex_t *" mutex );
|
|
|
|
.fi
|
|
|
|
.PP
|
|
|
|
This GNU-specific API, which first appeared in glibc 2.4,
|
|
|
|
is nowadays obsolete and should not be used in new programs.
|
2020-05-21 08:00:37 +00:00
|
|
|
.SH EXAMPLES
|
2017-09-12 13:24:28 +00:00
|
|
|
See
|
|
|
|
.BR pthread_mutexattr_setrobust (3).
|
2017-09-11 12:50:12 +00:00
|
|
|
.SH SEE ALSO
|
|
|
|
.ad l
|
|
|
|
.nh
|
|
|
|
.BR pthread_mutex_lock (3),
|
2020-05-19 05:23:34 +00:00
|
|
|
.BR pthread_mutexattr_init (3),
|
2017-09-11 12:50:12 +00:00
|
|
|
.BR pthread_mutexattr_getrobust (3),
|
2019-09-27 12:12:01 +00:00
|
|
|
.BR pthread_mutexattr_setrobust (3),
|
2017-09-11 12:50:12 +00:00
|
|
|
.BR pthreads (7)
|