]>
Commit | Line | Data |
---|---|---|
9d481653 MK |
1 | .\" Copyright (c) 2017, Michael Kerrisk <mtk.manpages@gmail.com> |
2 | .\" | |
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. | |
7 | .\" | |
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. | |
12 | .\" | |
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 | |
19 | .\" professionally. | |
20 | .\" | |
21 | .\" Formatted or processed versions of this manual, if unaccompanied by | |
22 | .\" the source, must acknowledge the copyright and authors of this work. | |
23 | .\" %%%LICENSE_END | |
24 | .\" | |
25 | .TH PTHREAD_MUTEXATTR_INIT 3 2017-08-20 "Linux" "Linux Programmer's Manual" | |
26 | .SH NAME | |
27 | pthread_mutexattr_init, pthread_mutexattr_destroy \- initialize and | |
28 | destroy a mutex attributes object | |
29 | .SH SYNOPSIS | |
30 | .nf | |
31 | .B #include <pthread.h> | |
32 | .PP | |
0f247512 | 33 | .BI "int pthread_mutexattr_init(pthread_mutexattr_t *" attr ");" |
34 | .BI "int pthread_mutexattr_destroy(pthread_mutexattr_t *" attr ");" | |
9d481653 MK |
35 | .fi |
36 | .PP | |
37 | Compile and link with \fI\-pthread\fP. | |
38 | .SH DESCRIPTION | |
39 | The | |
40 | .BR pthread_mutexattr_init () | |
41 | function initializes the mutex attributes object pointed to by | |
42 | .I attr | |
43 | with default values for all attributes defined by the implementation. | |
44 | .PP | |
45 | The results of initializing an already initialized mutex attributes | |
46 | object are undefined. | |
47 | .PP | |
48 | The | |
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 (). | |
53 | .PP | |
54 | The results of destroying an uninitialized mutex attributes | |
55 | object are undefined. | |
56 | .SH RETURN VALUE | |
57 | On success, these functions return 0. | |
58 | On error, they return a positive error number. | |
59 | .SH CONFORMING TO | |
60 | POSIX.1-2001, POSIX.1-2008. | |
61 | .SH NOTES | |
62 | Subsequent changes to a mutex attributes object do not affect mutex that | |
63 | have already been initialized using that object. | |
64 | .SH SEE ALSO | |
65 | .ad l | |
66 | .nh | |
67 | .BR pthread_mutex_init (3), | |
68 | .BR pthread_mutexattr_getrobust (3), | |
1a14615c | 69 | .BR pthread_mutexattr_getpshared (3), |
9d481653 | 70 | .BR pthreads (7) |