1pthread_mutexattr_init(3) Library Functions Manual pthread_mutexattr_init(3)
2
3
4
6 pthread_mutexattr_init, pthread_mutexattr_destroy - initialize and de‐
7 stroy a mutex attributes object
8
10 POSIX threads library (libpthread, -lpthread)
11
13 #include <pthread.h>
14
15 int pthread_mutexattr_init(pthread_mutexattr_t *attr);
16 int pthread_mutexattr_destroy(pthread_mutexattr_t *attr);
17
19 The pthread_mutexattr_init() function initializes the mutex attributes
20 object pointed to by attr with default values for all attributes de‐
21 fined by the implementation.
22
23 The results of initializing an already initialized mutex attributes ob‐
24 ject are undefined.
25
26 The pthread_mutexattr_destroy() function destroys a mutex attribute ob‐
27 ject (making it uninitialized). Once a mutex attributes object has
28 been destroyed, it can be reinitialized with pthread_mutexattr_init().
29
30 The results of destroying an uninitialized mutex attributes object are
31 undefined.
32
34 On success, these functions return 0. On error, they return a positive
35 error number.
36
38 POSIX.1-2008.
39
41 POSIX.1-2001.
42
44 Subsequent changes to a mutex attributes object do not affect mutex
45 that have already been initialized using that object.
46
48 pthread_mutex_init(3), pthread_mutexattr_getpshared(3),
49 pthread_mutexattr_getrobust(3), pthreads(7)
50
51
52
53Linux man-pages 6.04 2023-03-30 pthread_mutexattr_init(3)