1 .\" Copyright (c) 2017, Michael Kerrisk <mtk.manpages@gmail.com>
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date. The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein. The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
25 .TH PTHREAD_MUTEXATTR_INIT 3 2019-10-10 "Linux" "Linux Programmer's Manual"
27 pthread_mutexattr_init, pthread_mutexattr_destroy \- initialize and
28 destroy a mutex attributes object
31 .B #include <pthread.h>
33 .BI "int pthread_mutexattr_init(pthread_mutexattr_t *" attr ");"
34 .BI "int pthread_mutexattr_destroy(pthread_mutexattr_t *" attr ");"
37 Compile and link with \fI\-pthread\fP.
40 .BR pthread_mutexattr_init ()
41 function initializes the mutex attributes object pointed to by
43 with default values for all attributes defined by the implementation.
45 The results of initializing an already initialized mutex attributes
49 .BR pthread_mutexattr_destroy ()
50 function destroys a mutex attribute object (making it uninitialized).
51 Once a mutex attributes object has been destroyed, it can be reinitialized with
52 .BR pthread_mutexattr_init ().
54 The results of destroying an uninitialized mutex attributes
57 On success, these functions return 0.
58 On error, they return a positive error number.
60 POSIX.1-2001, POSIX.1-2008.
62 Subsequent changes to a mutex attributes object do not affect mutex that
63 have already been initialized using that object.
67 .BR pthread_mutex_init (3),
68 .BR pthread_mutexattr_getpshared (3),
69 .BR pthread_mutexattr_getrobust (3),