Print this page
10067 Miscellaneous man page typos
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Andy Fiddaman <andy@omniosce.org>
Reviewed by: Volker A. Brandt <vab@bb-c.de>
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man3c/pthread_rwlock_rdlock.3c
+++ new/usr/src/man/man3c/pthread_rwlock_rdlock.3c
1 1 .\"
2 2 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
3 3 .\" permission to reproduce portions of its copyrighted documentation.
4 4 .\" Original documentation from The Open Group can be obtained online at
5 5 .\" http://www.opengroup.org/bookstore/.
6 6 .\"
7 7 .\" The Institute of Electrical and Electronics Engineers and The Open
8 8 .\" Group, have given us permission to reprint portions of their
9 9 .\" documentation.
10 10 .\"
11 11 .\" In the following statement, the phrase ``this text'' refers to portions
12 12 .\" of the system documentation.
13 13 .\"
14 14 .\" Portions of this text are reprinted and reproduced in electronic form
15 15 .\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
16 16 .\" Standard for Information Technology -- Portable Operating System
17 17 .\" Interface (POSIX), The Open Group Base Specifications Issue 6,
18 18 .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
19 19 .\" Engineers, Inc and The Open Group. In the event of any discrepancy
20 20 .\" between these versions and the original IEEE and The Open Group
21 21 .\" Standard, the original IEEE and The Open Group Standard is the referee
22 22 .\" document. The original Standard can be obtained online at
23 23 .\" http://www.opengroup.org/unix/online.html.
24 24 .\"
25 25 .\" This notice shall appear on any product containing this material.
26 26 .\"
27 27 .\" The contents of this file are subject to the terms of the
28 28 .\" Common Development and Distribution License (the "License").
29 29 .\" You may not use this file except in compliance with the License.
30 30 .\"
31 31 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
32 32 .\" or http://www.opensolaris.org/os/licensing.
33 33 .\" See the License for the specific language governing permissions
34 34 .\" and limitations under the License.
35 35 .\"
36 36 .\" When distributing Covered Code, include this CDDL HEADER in each
37 37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
38 38 .\" If applicable, add the following below this CDDL HEADER, with the
39 39 .\" fields enclosed by brackets "[]" replaced with your own identifying
40 40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
41 41 .\"
42 42 .\"
43 43 .\" Copyright 1991, 1992, 1994, The X/Open Company Ltd.
44 44 .\" Copyright (c) 2001, The IEEE and The Open Group. All Rights Reserved.
45 45 .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
46 46 .\"
47 47 .TH PTHREAD_RWLOCK_RDLOCK 3C "Mar 23, 2005"
48 48 .SH NAME
49 49 pthread_rwlock_rdlock, pthread_rwlock_tryrdlock \- lock or attempt to lock
50 50 read-write lock object for reading
51 51 .SH SYNOPSIS
52 52 .LP
53 53 .nf
54 54 cc -mt [ \fIflag\fR... ] \fIfile\fR... -lpthread [ \fIlibrary\fR... ]
55 55 #include <pthread.h>
↓ open down ↓ |
55 lines elided |
↑ open up ↑ |
56 56
57 57 \fBint\fR \fBpthread_rwlock_rdlock\fR(\fBpthread_rwlock_t\fR \fI*rwlock\fR);
58 58 .fi
59 59
60 60 .LP
61 61 .nf
62 62 \fBint\fR \fBpthread_rwlock_tryrdlock\fR(\fBpthread_rwlock_t\fR \fI*rwlock\fR);
63 63 .fi
64 64
65 65 .SH DESCRIPTION
66 -.sp
67 66 .LP
68 67 The \fBpthread_rwlock_rdlock()\fR function applies a read lock to the
69 68 read-write lock referenced by \fIrwlock\fR. The calling thread acquires the
70 69 read lock if a writer does not hold the lock and there are no writers blocked
71 70 on the lock.
72 71 .sp
73 72 .LP
74 73 The calling thread does not acquire the lock if a writer holds the lock or if
75 74 writers of higher or equal priority are blocked on the lock; otherwise, the
76 75 calling thread acquires the lock. If the read lock is not acquired, the calling
77 76 thread blocks until it can acquire the lock.
78 77 .sp
79 78 .LP
80 79 A thread can hold multiple concurrent read locks on \fIrwlock\fR (that is,
81 80 successfully call the \fBpthread_rwlock_rdlock()\fR function \fIn\fR times). If
82 81 so, the thread must perform matching unlocks (that is, it must call the
83 82 \fBpthread_rwlock_unlock()\fR function \fIn\fR times).
84 83 .sp
85 84 .LP
↓ open down ↓ |
9 lines elided |
↑ open up ↑ |
86 85 The maximum number of concurrent read locks that a thread can hold on one
87 86 read-write lock is currently set at 100,000, though this number could change in
88 87 a future release. There is no imposed limit on the number of different threads
89 88 that can apply a read lock to one read-write lock.
90 89 .sp
91 90 .LP
92 91 The \fBpthread_rwlock_tryrdlock()\fR function applies a read lock like the
93 92 \fBpthread_rwlock_rdlock()\fR function, with the exception that the function
94 93 fails if the equivalent \fBpthread_rwlock_rdlock()\fR call would have blocked
95 94 the calling thread. In no case will the \fBpthread_rwlock_tryrdlock()\fR
96 -function ever bloc. It always either acquires the lock or fails and returns
95 +function ever block. It always either acquires the lock or fails and returns
97 96 immediately.
98 97 .sp
99 98 .LP
100 99 Results are undefined if any of these functions are called with an
101 100 uninitialized read-write lock.
102 101 .sp
103 102 .LP
104 103 If a signal is delivered to a thread waiting for a read-write lock for reading,
105 104 upon return from the signal handler the thread resumes waiting for the
106 105 read-write lock for reading as if it was not interrupted.
107 106 .SH RETURN VALUES
108 -.sp
109 107 .LP
110 108 If successful, the \fBpthread_rwlock_rdlock()\fR function returns \fB0\fR.
111 109 Otherwise, an error number is returned to indicate the error.
112 110 .sp
113 111 .LP
114 112 The \fBpthread_rwlock_tryrdlock()\fR function returns \fB0\fR if the lock for
115 113 reading on the read-write lock object referenced by \fIrwlock\fR is acquired.
116 114 Otherwise an error number is returned to indicate the error.
117 115 .SH ERRORS
118 -.sp
119 116 .LP
120 117 The \fBpthread_rwlock_rdlock()\fR and \fBpthread_rwlock_tryrdlock()\fR
121 118 functions will fail if:
122 119 .sp
123 120 .ne 2
124 121 .na
125 122 \fB\fBEAGAIN\fR\fR
126 123 .ad
127 124 .RS 10n
128 125 The read lock could not be acquired because the maximum number of read locks by
129 126 the current thread for \fIrwlock\fR has been exceeded.
130 127 .RE
131 128
132 129 .sp
133 130 .LP
134 131 The \fBpthread_rwlock_rdlock()\fR function will fail if:
135 132 .sp
136 133 .ne 2
137 134 .na
138 135 \fB\fBEDEADLK\fR\fR
139 136 .ad
140 137 .RS 11n
141 138 The current thread already owns the read-write lock for writing.
142 139 .RE
143 140
144 141 .sp
145 142 .LP
146 143 The \fBpthread_rwlock_tryrdlock()\fR function will fail if:
147 144 .sp
↓ open down ↓ |
19 lines elided |
↑ open up ↑ |
148 145 .ne 2
149 146 .na
150 147 \fB\fBEBUSY\fR\fR
151 148 .ad
152 149 .RS 9n
153 150 The read-write lock could not be acquired for reading because a writer holds
154 151 the lock or a writer with the appropriate priority was blocked on it.
155 152 .RE
156 153
157 154 .SH ATTRIBUTES
158 -.sp
159 155 .LP
160 156 See \fBattributes\fR(5) for descriptions of the following attributes:
161 157 .sp
162 158
163 159 .sp
164 160 .TS
165 161 box;
166 162 c | c
167 163 l | l .
168 164 ATTRIBUTE TYPE ATTRIBUTE VALUE
169 165 _
170 166 Interface Stability Standard
171 167 _
172 168 MT-Level MT-Safe
173 169 .TE
174 170
175 171 .SH SEE ALSO
176 -.sp
177 172 .LP
178 173 \fBpthread_rwlock_init\fR(3C), \fBpthread_rwlock_wrlock\fR(3C),
179 174 \fBpthread_rwlockattr_init\fR(3C), \fBpthread_rwlock_unlock\fR(3C),
180 175 \fBattributes\fR(5), \fBstandards\fR(5)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX