xref: /openbsd-src/lib/libpthread/man/pthread_rwlock_destroy.3 (revision 86f9d4cdda0e0267dccd8755ac0035525579c4a7)
1*86f9d4cdStedu.\" $OpenBSD: pthread_rwlock_destroy.3,v 1.9 2013/06/05 03:44:50 tedu Exp $
2f8344ebdSd.\" Copyright (c) 1998 Alex Nash
3f8344ebdSd.\" All rights reserved.
4f8344ebdSd.\"
5f8344ebdSd.\" Redistribution and use in source and binary forms, with or without
6f8344ebdSd.\" modification, are permitted provided that the following conditions
7f8344ebdSd.\" are met:
8f8344ebdSd.\" 1. Redistributions of source code must retain the above copyright
9f8344ebdSd.\"    notice, this list of conditions and the following disclaimer.
10f8344ebdSd.\" 2. Redistributions in binary form must reproduce the above copyright
11f8344ebdSd.\"    notice, this list of conditions and the following disclaimer in the
12f8344ebdSd.\"    documentation and/or other materials provided with the distribution.
13f8344ebdSd.\"
14f8344ebdSd.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15f8344ebdSd.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16f8344ebdSd.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17f8344ebdSd.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18f8344ebdSd.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19f8344ebdSd.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20f8344ebdSd.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21f8344ebdSd.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22f8344ebdSd.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23f8344ebdSd.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24f8344ebdSd.\" SUCH DAMAGE.
25f8344ebdSd.\"
2674493c91Sd.\" $FreeBSD: pthread_rwlock_destroy.3,v 1.3 1999/08/28 00:03:09 peter Exp $
27f8344ebdSd.\"
28*86f9d4cdStedu.Dd $Mdocdate: June 5 2013 $
29f8344ebdSd.Dt PTHREAD_RWLOCK_DESTROY 3
30f8344ebdSd.Os
31f8344ebdSd.Sh NAME
32f8344ebdSd.Nm pthread_rwlock_destroy
33f8344ebdSd.Nd destroy a read/write lock
34f8344ebdSd.Sh SYNOPSIS
35*86f9d4cdStedu.In pthread.h
36f8344ebdSd.Ft int
37f8344ebdSd.Fn pthread_rwlock_destroy "pthread_rwlock_t *lock"
38f8344ebdSd.Sh DESCRIPTION
39f8344ebdSdThe
40f8344ebdSd.Fn pthread_rwlock_destroy
41f8344ebdSdfunction is used to destroy a read/write lock previously created with
42f8344ebdSd.Fn pthread_rwlock_init .
43f8344ebdSd.Sh RETURN VALUES
44f8344ebdSdIf successful, the
45f8344ebdSd.Fn pthread_rwlock_destroy
4679ad192cSjmcfunction will return zero.
4779ad192cSjmcOtherwise an error number will be returned to indicate the error.
48f8344ebdSd.Sh ERRORS
49f8344ebdSdThe
50f8344ebdSd.Fn pthread_rwlock_destroy
51f8344ebdSdfunction will fail if:
52f8344ebdSd.Bl -tag -width Er
53f8344ebdSd.It Bq Er EPERM
54f8344ebdSdThe caller does not have the privilege to perform the operation.
55f8344ebdSd.El
56f8344ebdSd.Pp
57f8344ebdSdThe
58f8344ebdSd.Fn pthread_rwlock_destroy
59f8344ebdSdfunction may fail if:
60f8344ebdSd.Bl -tag -width Er
61f8344ebdSd.It Bq Er EBUSY
62f8344ebdSdThe system has detected an attempt to destroy the object referenced by
63f8344ebdSd.Fa lock
64f8344ebdSdwhile it is locked.
65f8344ebdSd.It Bq Er EINVAL
66f8344ebdSdThe value specified by
67f8344ebdSd.Fa lock
68f8344ebdSdis invalid.
69f8344ebdSd.El
70c062f733Sjmc.Sh SEE ALSO
71c062f733Sjmc.Xr pthread_rwlock_init 3
72c062f733Sjmc.Sh STANDARDS
73c062f733SjmcThe
74c062f733Sjmc.Fn pthread_rwlock_destroy
75c062f733Sjmcfunction is expected to conform to
76c062f733Sjmc.St -susv2 .
77f8344ebdSd.Sh HISTORY
78f8344ebdSdThe
79f8344ebdSd.Fn pthread_rwlock_destroy
80f8344ebdSdfunction first appeared in
8174493c91Sd.Fx 3.0
8274493c91Sdand
83c536383fSalex.Ox 2.5 .
84