xref: /openbsd-src/lib/libpthread/man/pthread_mutex_destroy.3 (revision 960f8fbd44b728dd399b6f0cecfac7f0443ae77a)
1a278733dSd.\" Copyright (c) 1997 Brian Cully <shmit@kublai.com>
2a278733dSd.\" All rights reserved.
3a278733dSd.\"
4a278733dSd.\" Redistribution and use in source and binary forms, with or without
5a278733dSd.\" modification, are permitted provided that the following conditions
6a278733dSd.\" are met:
7a278733dSd.\" 1. Redistributions of source code must retain the above copyright
8a278733dSd.\"    notice, this list of conditions and the following disclaimer.
9a278733dSd.\" 2. Redistributions in binary form must reproduce the above copyright
10a278733dSd.\"    notice, this list of conditions and the following disclaimer in the
11a278733dSd.\"    documentation and/or other materials provided with the distribution.
12a278733dSd.\" 3. Neither the name of the author nor the names of any co-contributors
13a278733dSd.\"    may be used to endorse or promote products derived from this software
14a278733dSd.\"    without specific prior written permission.
15a278733dSd.\"
16a278733dSd.\" THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL AND CONTRIBUTORS ``AS IS'' AND
17a278733dSd.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18a278733dSd.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19a278733dSd.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20a278733dSd.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21a278733dSd.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22a278733dSd.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23a278733dSd.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24a278733dSd.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25a278733dSd.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26a278733dSd.\" SUCH DAMAGE.
27a278733dSd.\"
28a278733dSd.Dd July 29, 1998
29a278733dSd.Dt PTHREAD_MUTEX_DESTROY 3
30a278733dSd.Os BSD 4
31a278733dSd.Sh NAME
32a278733dSd.Nm pthread_mutex_destroy
33a278733dSd.Nd free resources allocated for a mutex
34a278733dSd.Sh SYNOPSIS
35a278733dSd.Fd #include <pthread.h>
36a278733dSd.Ft int
37a278733dSd.Fn pthread_mutex_destroy "pthread_mutex_t *mutex"
38a278733dSd.Sh DESCRIPTION
39a278733dSdThe
40a278733dSd.Fn pthread_mutex_destroy
41a278733dSdfunction frees the resources allocated for
42a278733dSd.Fa mutex .
43a278733dSd.Sh RETURN VALUES
44a278733dSdIf successful,
45a278733dSd.Fn pthread_mutex_destroy
46a278733dSdwill return zero, otherwise an error number will be returned to
47a278733dSdindicate the error.
48a278733dSd.Sh ERRORS
49a278733dSd.Fn pthread_mutex_destroy
50a278733dSdwill fail if:
51a278733dSd.Bl -tag -width Er
52a278733dSd.It Bq Er EINVAL
53a278733dSdThe value specified by
54a278733dSd.Fa mutex
55a278733dSdis invalid.
56a278733dSd.It Bq Er EBUSY
57*960f8fbdSderaadt.Fa mutex
58a278733dSdis locked by another thread.
59a278733dSd.El
60a278733dSd.Pp
61a278733dSd.Sh SEE ALSO
62a278733dSd.Xr pthread_mutex_init 3 ,
63a278733dSd.Xr pthread_mutex_lock 3 ,
64f8344ebdSd.Xr pthread_mutex_trylock 3 ,
65f8344ebdSd.Xr pthread_mutex_unlock 3
66a278733dSd.Sh STANDARDS
67a278733dSd.Fn pthread_mutex_destroy
68a278733dSdconforms to ISO/IEC 9945-1 ANSI/IEEE
69a278733dSd.Pq Dq Tn POSIX
70a278733dSdStd 1003.1 Second Edition 1996-07-12.
71