9103 opengroup acknowledgement should be properly formatted in man pages
[unleashed.git] / usr / src / man / man3c / pthread_rwlock_unlock.3c
blob753bce2effc58018940ebb1c405a2e9cc9568aa5
1 .\"
2 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
3 .\" permission to reproduce portions of its copyrighted documentation.
4 .\" Original documentation from The Open Group can be obtained online at
5 .\" http://www.opengroup.org/bookstore/.
6 .\"
7 .\" The Institute of Electrical and Electronics Engineers and The Open
8 .\" Group, have given us permission to reprint portions of their
9 .\" documentation.
10 .\"
11 .\" In the following statement, the phrase ``this text'' refers to portions
12 .\" of the system documentation.
13 .\"
14 .\" Portions of this text are reprinted and reproduced in electronic form
15 .\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
16 .\" Standard for Information Technology -- Portable Operating System
17 .\" Interface (POSIX), The Open Group Base Specifications Issue 6,
18 .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
19 .\" Engineers, Inc and The Open Group.  In the event of any discrepancy
20 .\" between these versions and the original IEEE and The Open Group
21 .\" Standard, the original IEEE and The Open Group Standard is the referee
22 .\" document.  The original Standard can be obtained online at
23 .\" http://www.opengroup.org/unix/online.html.
24 .\"
25 .\" This notice shall appear on any product containing this material.
26 .\"
27 .\" The contents of this file are subject to the terms of the
28 .\" Common Development and Distribution License (the "License").
29 .\" You may not use this file except in compliance with the License.
30 .\"
31 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
32 .\" or http://www.opensolaris.org/os/licensing.
33 .\" See the License for the specific language governing permissions
34 .\" and limitations under the License.
35 .\"
36 .\" When distributing Covered Code, include this CDDL HEADER in each
37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
38 .\" If applicable, add the following below this CDDL HEADER, with the
39 .\" fields enclosed by brackets "[]" replaced with your own identifying
40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
41 .\"
42 .\"
43 .\" Copyright (c) 2001, The IEEE and The Open Group.  All Rights Reserved.
44 .\" Portions Copyright (c) 2008, Sun Microsystems, Inc.  All Rights Reserved.
45 .\"
46 .TH PTHREAD_RWLOCK_UNLOCK 3C "Mar 23, 2005"
47 .SH NAME
48 pthread_rwlock_unlock \- unlock read-write lock object
49 .SH SYNOPSIS
50 .LP
51 .nf
52 cc -mt [ \fIflag\fR... ] \fIfile\fR... -lpthread [ \fIlibrary\fR... ]
53 #include <pthread.h>
55 \fBint\fR \fBpthread_rwlock_unlock\fR(\fBpthread_rwlock_t\fR \fI*rwlock\fR);
56 .fi
58 .SH DESCRIPTION
59 .sp
60 .LP
61 The \fBpthread_rwlock_unlock()\fR function is called to release a lock held on
62 the read-write lock object referenced by \fIrwlock\fR. Results are undefined if
63 the read-write lock \fIrwlock\fR is not held by the calling thread.
64 .sp
65 .LP
66 If this function is called to release a read lock from the read-write lock
67 object and there are other read locks currently held on this read-write lock
68 object, the read-write lock object remains in the read locked state. If this
69 function releases the calling thread's last read lock on this read-write lock
70 object, then the calling thread is no longer one of the owners of the object.
71 If this function releases the last read lock for this read-write lock object,
72 the read-write lock object will be put in the unlocked state with no owners.
73 .sp
74 .LP
75 If this function is called to release a write lock for this read-write lock
76 object, the read-write lock object will be put in the unlocked state with no
77 owners.
78 .sp
79 .LP
80 If the call to the \fBpthread_rwlock_unlock()\fR function results in the
81 read-write lock object becoming unlocked and there are multiple threads waiting
82 to acquire the read-write lock object for writing, the scheduling policy is
83 used to determine which thread acquires the read-write lock object for writing.
84 If there are multiple threads waiting to acquire the read-write lock object for
85 reading, the scheduling policy is used to determine the order in which the
86 waiting threads acquire the read-write lock object for reading.  If there are
87 multiple threads blocked on \fIrwlock\fR for both read locks and write locks,
88 it is unspecified whether the readers acquire the lock first or whether a
89 writer acquires the lock first.
90 .sp
91 .LP
92 Results are undefined if any of these functions are called with an
93 uninitialized read-write lock.
94 .SH RETURN VALUES
95 .sp
96 .LP
97 If successful, the \fBpthread_rwlock_unlock()\fR function returns \fB0\fR.
98 Otherwise, an error number is returned to indicate the error.
99 .SH ATTRIBUTES
102 See \fBattributes\fR(5) for descriptions of the following attributes:
107 box;
108 c | c
109 l | l .
110 ATTRIBUTE TYPE  ATTRIBUTE VALUE
112 Interface Stability     Standard
114 MT-Level        MT-Safe
117 .SH SEE ALSO
120 \fBpthread_rwlock_init\fR(3C), \fBpthread_rwlock_rdlock\fR(3C),
121 \fBpthread_rwlock_wrlock\fR(3C), \fBpthread_rwlockattr_init\fR(3C),
122 \fBattributes\fR(5), \fBstandards\fR(5)