1pthread_mutex_consistent(3)Library Functions Manualpthread_mutex_consistent(3)
2
3
4

NAME

6       pthread_mutex_consistent - make a robust mutex consistent
7

LIBRARY

9       POSIX threads library (libpthread, -lpthread)
10

SYNOPSIS

12       #include <pthread.h>
13
14       int pthread_mutex_consistent(pthread_mutex_t *mutex);
15
16   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
17
18       pthread_mutex_consistent():
19           _POSIX_C_SOURCE >= 200809L
20

DESCRIPTION

22       This  function makes a robust mutex consistent if it is in an inconsis‐
23       tent state.  A mutex can be left in an inconsistent state if its  owner
24       terminates  while  holding  the mutex, in which case the next owner who
25       acquires the mutex will succeed and be notified by a  return  value  of
26       EOWNERDEAD from a call to pthread_mutex_lock().
27

RETURN VALUE

29       On  success,  pthread_mutex_consistent()  returns 0.  Otherwise, it re‐
30       turns a positive error number to indicate the error.
31

ERRORS

33       EINVAL The mutex is either not robust or  is  not  in  an  inconsistent
34              state.
35

STANDARDS

37       POSIX.1-2008.
38

HISTORY

40       glibc 2.12.  POSIX.1-2008.
41
42       Before  the  addition of pthread_mutex_consistent() to POSIX, glibc de‐
43       fined the following equivalent nonstandard function if _GNU_SOURCE  was
44       defined:
45
46       [[deprecated]]
47       int pthread_mutex_consistent_np(const pthread_mutex_t *mutex);
48
49       This  GNU-specific  API, which first appeared in glibc 2.4, is nowadays
50       obsolete and should not be used in new programs; since  glibc  2.34  it
51       has been marked as deprecated.
52

NOTES

54       pthread_mutex_consistent()  simply  informs the implementation that the
55       state (shared data) guarded by the mutex has been restored to a consis‐
56       tent state and that normal operations can now be performed with the mu‐
57       tex.  It is the application's responsibility to ensure that the  shared
58       data has been restored to a consistent state before calling pthread_mu‐
59       tex_consistent().
60

EXAMPLES

62       See pthread_mutexattr_setrobust(3).
63

SEE ALSO

65       pthread_mutex_lock(3), pthread_mutexattr_getrobust(3),
66       pthread_mutexattr_init(3), pthread_mutexattr_setrobust(3), pthreads(7)
67
68
69
70Linux man-pages 6.05              2023-03-30       pthread_mutex_consistent(3)
Impressum