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