1pthread_rwlockattr_init(3CS)tandard C Library Functionpsthread_rwlockattr_init(3C)
2
3
4
6 pthread_rwlockattr_init, pthread_rwlockattr_destroy - initialize or
7 destroy read-write lock attributes object
8
10 cc -mt [ flag... ] file... -lpthread [ library... ]
11 #include <pthread.h>
12
13 int pthread_rwlockattr_init(pthread_rwlockattr_t *attr);
14
15
16 int pthread_rwlockattr_destroy(pthread_rwlockattr_t *attr);
17
18
20 The pthread_rwlockattr_init() function initializes a read-write lock
21 attributes object attr with the default value for all of the attributes
22 defined by the implementation.
23
24
25 Results are undefined if pthread_rwlockattr_init() is called specifying
26 an already initialized read-write lock attributes object.
27
28
29 After a read-write lock attributes object has been used to initialize
30 one or more read-write locks, any function affecting the attributes
31 object (including destruction) does not affect any previously initial‐
32 ized read-write locks.
33
34
35 The pthread_rwlockattr_destroy() function destroys a read-write lock
36 attributes object. The effect of subsequent use of the object is unde‐
37 fined until the object is re-initialized by another call to
38 pthread_rwlockattr_init(). An implementation can cause pthread_rwlock‐
39 attr_destroy() to set the object referenced by attr to an invalid
40 value.
41
43 If successful, the pthread_rwlockattr_init() and pthread_rwlock‐
44 attr_destroy() functions return 0. Otherwise, an error number is
45 returned to indicate the error.
46
48 The pthread_rwlockattr_init() function will fail if:
49
50 ENOMEM Insufficient memory exists to initialize the read-write lock
51 attributes object.
52
53
54
55 The pthread_rwlockattr_destroy() function may fail if:
56
57 EINVAL The value specified by attr is invalid.
58
59
61 See attributes(5) for descriptions of the following attributes:
62
63
64
65
66 ┌─────────────────────────────┬─────────────────────────────┐
67 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
68 ├─────────────────────────────┼─────────────────────────────┤
69 │Interface Stability │Standard │
70 ├─────────────────────────────┼─────────────────────────────┤
71 │MT-Level │MT-Safe │
72 └─────────────────────────────┴─────────────────────────────┘
73
75 pthread_rwlock_init(3C), pthread_rwlock_rdlock(3C),
76 pthread_rwlock_unlock(3C), pthread_rwlock_wrlock(3C), pthread_rwlock‐
77 attr_getpshared(3C), attributes(5), standards(5)
78
79
80
81SunOS 5.11 23 Mar 2005 pthread_rwlockattr_init(3C)