1 .\" Copyright (c) 2017, Michael Kerrisk <mtk.manpages@gmail.com>
3 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .TH pthread_mutexattr_init 3 (date) "Linux man-pages (unreleased)"
7 pthread_mutexattr_init, pthread_mutexattr_destroy \- initialize and
8 destroy a mutex attributes object
11 .RI ( libpthread ", " \-lpthread )
14 .B #include <pthread.h>
16 .BI "int pthread_mutexattr_init(pthread_mutexattr_t *" attr ");"
17 .BI "int pthread_mutexattr_destroy(pthread_mutexattr_t *" attr ");"
21 .BR pthread_mutexattr_init ()
22 function initializes the mutex attributes object pointed to by
24 with default values for all attributes defined by the implementation.
26 The results of initializing an already initialized mutex attributes
30 .BR pthread_mutexattr_destroy ()
31 function destroys a mutex attribute object (making it uninitialized).
32 Once a mutex attributes object has been destroyed, it can be reinitialized with
33 .BR pthread_mutexattr_init ().
35 The results of destroying an uninitialized mutex attributes
38 On success, these functions return 0.
39 On error, they return a positive error number.
41 POSIX.1-2001, POSIX.1-2008.
43 Subsequent changes to a mutex attributes object do not affect mutex that
44 have already been initialized using that object.
48 .BR pthread_mutex_init (3),
49 .BR pthread_mutexattr_getpshared (3),
50 .BR pthread_mutexattr_getrobust (3),