From owner-freebsd-doc Thu Jul 30 12:50:20 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id MAA09332 for freebsd-doc-outgoing; Thu, 30 Jul 1998 12:50:20 -0700 (PDT) (envelope-from owner-freebsd-doc@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id MAA09225 for ; Thu, 30 Jul 1998 12:50:03 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id MAA16185; Thu, 30 Jul 1998 12:50:01 -0700 (PDT) Received: from coleridge.kublai.com (coleridge.kublai.com [207.96.1.116]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id MAA06534 for ; Thu, 30 Jul 1998 12:40:26 -0700 (PDT) (envelope-from shmit@natasya.kublai.com) Received: from natasya.kublai.com (natasya.kublai.com [207.172.25.236]) by coleridge.kublai.com (8.8.8/8.8.8) with ESMTP id LAA15964 for ; Thu, 30 Jul 1998 11:34:29 -0400 (EDT) (envelope-from shmit@natasya.kublai.com) Received: (from shmit@localhost) by natasya.kublai.com (8.8.8/8.8.8) id LAA29895; Thu, 30 Jul 1998 11:34:29 -0400 (EDT) Message-Id: <199807301534.LAA29895@natasya.kublai.com> Date: Thu, 30 Jul 1998 11:34:29 -0400 (EDT) From: shmit@kublai.com Reply-To: shmit@kublai.com To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: docs/7450: More pthreads manpages Sender: owner-freebsd-doc@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 7450 >Category: docs >Synopsis: More man pages for pthreads >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-doc >State: open >Quarter: >Keywords: >Date-Required: >Class: doc-bug >Submitter-Id: current-users >Arrival-Date: Thu Jul 30 12:50:00 PDT 1998 >Last-Modified: >Originator: Brian Cully >Organization: >Release: FreeBSD 3.0-CURRENT i386 >Environment: FreeBSD-current, but will probably apply to -stable, too. >Description: I've put together man pages for the pthread_cleanup, pthread_cond, and pthread_mutex routines. I've also tweaked pthread_create.3 to point to pthread_cleanup_push(3) and pthread_cleanup_pop(3). >How-To-Repeat: >Fix: Apply this patch: diff -cN man.old/Makefile.inc man/Makefile.inc *** man.old/Makefile.inc Thu Jul 30 11:29:53 1998 --- man/Makefile.inc Thu Jul 30 09:37:12 1998 *************** *** 4,10 **** .PATH: ${.CURDIR}/man ! MAN3+= pthread_create.3 \ pthread_detach.3 \ pthread_equal.3 \ pthread_exit.3 \ --- 4,18 ---- .PATH: ${.CURDIR}/man ! MAN3+= pthread_cleanup_pop.3 \ ! pthread_cleanup_push.3 \ ! pthread_cond_broadcast.3 \ ! pthread_cond_destroy.3 \ ! pthread_cond_init.3 \ ! pthread_cond_signal.3 \ ! pthread_cond_timedwait.3 \ ! pthread_cond_wait.3 \ ! pthread_create.3 \ pthread_detach.3 \ pthread_equal.3 \ pthread_exit.3 \ *************** *** 12,17 **** --- 20,30 ---- pthread_join.3 \ pthread_key_create.3 \ pthread_key_delete.3 \ + pthread_mutex_destroy.3 \ + pthread_mutex_init.3 \ + pthread_mutex_lock.3 \ + pthread_mutex_trylock.3 \ + pthread_mutex_unlock.3 \ pthread_once.3 \ pthread_self.3 \ pthread_setspecific.3 diff -cN man.old/pthread_cleanup_pop.3 man/pthread_cleanup_pop.3 *** man.old/pthread_cleanup_pop.3 Wed Dec 31 19:00:00 1969 --- man/pthread_cleanup_pop.3 Thu Jul 30 09:38:26 1998 *************** *** 0 **** --- 1,60 ---- + .\" Copyright (c) 1997 Brian Cully + .\" All rights reserved. + .\" + .\" Redistribution and use in source and binary forms, with or without + .\" modification, are permitted provided that the following conditions + .\" are met: + .\" 1. Redistributions of source code must retain the above copyright + .\" notice, this list of conditions and the following disclaimer. + .\" 2. Redistributions in binary form must reproduce the above copyright + .\" notice, this list of conditions and the following disclaimer in the + .\" documentation and/or other materials provided with the distribution. + .\" 3. Neither the name of the author nor the names of any co-contributors + .\" may be used to endorse or promote products derived from this software + .\" without specific prior written permission. + .\" + .\" THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL AND CONTRIBUTORS ``AS IS'' AND + .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + .\" SUCH DAMAGE. + .\" + .Dd July 30, 1998 + .Dt PTHREAD_CLEANUP_POP 3 + .Os BSD 4 + .Sh NAME + .Nm pthread_cleanup_pop + .Nd call the first cleanup routine + .Sh SYNOPSIS + .Fd #include + .Ft void + .Fn pthread_cleanup_pop "int execute" + .Sh DESCRIPTION + The + .Fn pthread_cleanup_pop + function pops the top cleanup routine off of the current threads cleanup + routine stack, and, if + .Fa execute + is non-zero, it will execute the function. If there is no cleanup routine + then + .Fn pthread_cleanup_pop + does nothing. + .Sh RETURN VALUES + .Fn pthread_cleanup_pop + does not return any value. + .Sh ERRORS + None + .Sh SEE ALSO + .Xr pthread_cleanup_push 3 , + .Xr pthread_exit 3 + .Sh STANDARDS + .Fn pthread_cleanup_pop + is expected to conform to IEEE + .Pq Dq Tn POSIX + Std 1003.1c when it is published. diff -cN man.old/pthread_cleanup_push.3 man/pthread_cleanup_push.3 *** man.old/pthread_cleanup_push.3 Wed Dec 31 19:00:00 1969 --- man/pthread_cleanup_push.3 Thu Jul 30 09:38:20 1998 *************** *** 0 **** --- 1,63 ---- + .\" Copyright (c) 1997 Brian Cully + .\" All rights reserved. + .\" + .\" Redistribution and use in source and binary forms, with or without + .\" modification, are permitted provided that the following conditions + .\" are met: + .\" 1. Redistributions of source code must retain the above copyright + .\" notice, this list of conditions and the following disclaimer. + .\" 2. Redistributions in binary form must reproduce the above copyright + .\" notice, this list of conditions and the following disclaimer in the + .\" documentation and/or other materials provided with the distribution. + .\" 3. Neither the name of the author nor the names of any co-contributors + .\" may be used to endorse or promote products derived from this software + .\" without specific prior written permission. + .\" + .\" THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL AND CONTRIBUTORS ``AS IS'' AND + .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + .\" SUCH DAMAGE. + .\" + .Dd July 30, 1998 + .Dt PTHREAD_CLEANUP_PUSH 3 + .Os BSD 4 + .Sh NAME + .Nm pthread_cleanup_push + .Nd add a cleanup function for thread exit + .Sh SYNOPSIS + .Fd #include + .Ft void + .Fn pthread_cleanup_push "void *(*cleanup_routine)(void *)" "void *arg" + .Sh DESCRIPTION + The + .Fn pthread_cleanup_push + function adds + .Fa cleanup_routine + to the top of the stack of cleanup handlers that + get called when the current thread exits. + .Pp + When + .Fn pthread_cleanup_push + is called, it is passed + .Fa arg + as its only argument. + .Sh RETURN VALUES + .Fn pthread_cleanup_push + does not return any value. + .Sh ERRORS + None + .Sh SEE ALSO + .Xr pthread_cleanup_pop 3 , + .Xr pthread_exit 3 + .Sh STANDARDS + .Fn pthread_cleanup_push + is expected to conform to IEEE + .Pq Dq Tn POSIX + Std 1003.1c when it is published. diff -cN man.old/pthread_cond_broadcast.3 man/pthread_cond_broadcast.3 *** man.old/pthread_cond_broadcast.3 Wed Dec 31 19:00:00 1969 --- man/pthread_cond_broadcast.3 Thu Jul 30 09:38:38 1998 *************** *** 0 **** --- 1,68 ---- + .\" Copyright (c) 1997 Brian Cully + .\" All rights reserved. + .\" + .\" Redistribution and use in source and binary forms, with or without + .\" modification, are permitted provided that the following conditions + .\" are met: + .\" 1. Redistributions of source code must retain the above copyright + .\" notice, this list of conditions and the following disclaimer. + .\" 2. Redistributions in binary form must reproduce the above copyright + .\" notice, this list of conditions and the following disclaimer in the + .\" documentation and/or other materials provided with the distribution. + .\" 3. Neither the name of the author nor the names of any co-contributors + .\" may be used to endorse or promote products derived from this software + .\" without specific prior written permission. + .\" + .\" THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL AND CONTRIBUTORS ``AS IS'' AND + .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + .\" SUCH DAMAGE. + .\" + .Dd July 28, 1998 + .Dt PTHREAD_COND_BROADCAST 3 + .Os BSD 4 + .Sh NAME + .Nm pthread_cond_broadcast + .Nd unblock all threads waiting for a condition variable + .Sh SYNOPSIS + .Fd #include + .Ft int + .Fn pthread_cond_broadcast "pthread_cond_t *cond" + .Sh DESCRIPTION + The + .Fn pthread_cond_broadcast + function unblocks all threads waiting for the condition variable + .Fa cond . + .Sh RETURN VALUES + If successful, the + .Fn pthread_cond_broadcast + function will return zero, otherwise an error number will be returned + to indicate the error. + .Sh ERRORS + .Fn pthread_cond_broadcast + will fail if: + .Bl -tag -width Er + .It Bq Er EINVAL + The value specified by + .Fa cond + is invalid. + .El + .Pp + .Sh SEE ALSO + .Xr pthread_cond_init 3 , + .Xr pthread_cond_destroy 3 , + .Xr pthread_cond_wait 3 , + .Xr pthread_cond_timedwait 3 , + .Xr pthread_cond_signal 3 + .Sh STANDARDS + .Fn pthread_cond_broadcast + is expected to conform to IEEE + .Pq Dq Tn POSIX + Std 1003.1c when it is published. diff -cN man.old/pthread_cond_destroy.3 man/pthread_cond_destroy.3 *** man.old/pthread_cond_destroy.3 Wed Dec 31 19:00:00 1969 --- man/pthread_cond_destroy.3 Thu Jul 30 09:38:52 1998 *************** *** 0 **** --- 1,72 ---- + .\" Copyright (c) 1997 Brian Cully + .\" All rights reserved. + .\" + .\" Redistribution and use in source and binary forms, with or without + .\" modification, are permitted provided that the following conditions + .\" are met: + .\" 1. Redistributions of source code must retain the above copyright + .\" notice, this list of conditions and the following disclaimer. + .\" 2. Redistributions in binary form must reproduce the above copyright + .\" notice, this list of conditions and the following disclaimer in the + .\" documentation and/or other materials provided with the distribution. + .\" 3. Neither the name of the author nor the names of any co-contributors + .\" may be used to endorse or promote products derived from this software + .\" without specific prior written permission. + .\" + .\" THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL AND CONTRIBUTORS ``AS IS'' AND + .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + .\" SUCH DAMAGE. + .\" + .Dd July 28, 1998 + .Dt PTHREAD_COND_DESTROY 3 + .Os BSD 4 + .Sh NAME + .Nm pthread_cond_destroy + .Nd destroy a condition variable + .Sh SYNOPSIS + .Fd #include + .Ft int + .Fn pthread_cond_destroy "pthread_cond_t *cond" + .Sh DESCRIPTION + The + .Fn pthread_cond_destroy + function frees the resources allocated by the condition variable + .Fa cond . + .Sh RETURN VALUES + If successful, the + .Fn pthread_cond_init + function will return zero, otherwise an error number will be returned + to indicate the error. + .Sh ERRORS + .Fn pthread_cond_destroy + will fail if: + .Bl -tag -width Er + .It Bq Er EINVAL + The value specified by + .Fa cond + is invalid. + .It Bq Er EBUSY + The variable + .Fa cond + is locked by another thread. + .El + .Pp + .Sh SEE ALSO + .Xr pthread_cond_init 3 , + .Xr pthread_cond_wait 3 , + .Xr pthread_cond_timedwait 3 , + .Xr pthread_cond_signal 3 , + .Xr pthread_cond_broadcast 3 + .Sh STANDARDS + .Fn pthread_cond_destroy + is expected to conform to IEEE + .Pq Dq Tn POSIX + Std 1003.1c when it is published. diff -cN man.old/pthread_cond_init.3 man/pthread_cond_init.3 *** man.old/pthread_cond_init.3 Wed Dec 31 19:00:00 1969 --- man/pthread_cond_init.3 Thu Jul 30 09:39:13 1998 *************** *** 0 **** --- 1,77 ---- + .\" Copyright (c) 1997 Brian Cully + .\" All rights reserved. + .\" + .\" Redistribution and use in source and binary forms, with or without + .\" modification, are permitted provided that the following conditions + .\" are met: + .\" 1. Redistributions of source code must retain the above copyright + .\" notice, this list of conditions and the following disclaimer. + .\" 2. Redistributions in binary form must reproduce the above copyright + .\" notice, this list of conditions and the following disclaimer in the + .\" documentation and/or other materials provided with the distribution. + .\" 3. Neither the name of the author nor the names of any co-contributors + .\" may be used to endorse or promote products derived from this software + .\" without specific prior written permission. + .\" + .\" THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL AND CONTRIBUTORS ``AS IS'' AND + .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + .\" SUCH DAMAGE. + .\" + .Dd July 28, 1998 + .Dt PTHREAD_COND_INIT 3 + .Os BSD 4 + .Sh NAME + .Nm pthread_cond_init + .Nd create a condition variable + .Sh SYNOPSIS + .Fd #include + .Ft int + .Fn pthread_cond_init "pthread_cond_t *cond" "pthread_condattr_t *attr" + .Sh DESCRIPTION + The + .Fn pthread_cond_init + function creates a new condition variable, with attributes specified with + .Fa attr . + If + .Fa attr + is NULL the default attributes are used. + .Sh RETURN VALUES + If successful, the + .Fn pthread_cond_init + function will return zero and put the new condition variable id into + .Fa cond , + otherwise an error number will be returned to indicate the error. + .Sh ERRORS + .Fn pthread_cond_init + will fail if: + .Bl -tag -width Er + .It Bq Er EINVAL + The value specified by + .Fa attr + is invalid. + .It Bq Er ENOMEM + The process cannot allocate enough memory to create another condition + variable. + .It Bq Er EAGAIN + The temporarily lacks the resources to create another condition variable. + .El + .Pp + .Sh SEE ALSO + .Xr pthread_cond_destroy 3 , + .Xr pthread_cond_wait 3 , + .Xr pthread_cond_timedwait 3 , + .Xr pthread_cond_signal 3 , + .Xr pthread_cond_broadcast 3 + .Sh STANDARDS + .Fn pthread_cond_init + is expected to conform to IEEE + .Pq Dq Tn POSIX + Std 1003.1c when it is published. diff -cN man.old/pthread_cond_signal.3 man/pthread_cond_signal.3 *** man.old/pthread_cond_signal.3 Wed Dec 31 19:00:00 1969 --- man/pthread_cond_signal.3 Thu Jul 30 09:39:24 1998 *************** *** 0 **** --- 1,68 ---- + .\" Copyright (c) 1997 Brian Cully + .\" All rights reserved. + .\" + .\" Redistribution and use in source and binary forms, with or without + .\" modification, are permitted provided that the following conditions + .\" are met: + .\" 1. Redistributions of source code must retain the above copyright + .\" notice, this list of conditions and the following disclaimer. + .\" 2. Redistributions in binary form must reproduce the above copyright + .\" notice, this list of conditions and the following disclaimer in the + .\" documentation and/or other materials provided with the distribution. + .\" 3. Neither the name of the author nor the names of any co-contributors + .\" may be used to endorse or promote products derived from this software + .\" without specific prior written permission. + .\" + .\" THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL AND CONTRIBUTORS ``AS IS'' AND + .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + .\" SUCH DAMAGE. + .\" + .Dd July 28, 1998 + .Dt PTHREAD_COND_SIGNAL 3 + .Os BSD 4 + .Sh NAME + .Nm pthread_cond_signal + .Nd unblock a thread waiting for a condition variable + .Sh SYNOPSIS + .Fd #include + .Ft int + .Fn pthread_cond_signal "pthread_cond_t *cond" + .Sh DESCRIPTION + The + .Fn pthread_cond_signal + function unblocks one thread waiting for the condition variable + .Fa cond . + .Sh RETURN VALUES + If successful, the + .Fn pthread_cond_signal + function will return zero, otherwise an error number will be returned + to indicate the error. + .Sh ERRORS + .Fn pthread_cond_signal + will fail if: + .Bl -tag -width Er + .It Bq Er EINVAL + The value specified by + .Fa cond + is invalid. + .El + .Pp + .Sh SEE ALSO + .Xr pthread_cond_init 3 , + .Xr pthread_cond_destroy 3 , + .Xr pthread_cond_wait 3 , + .Xr pthread_cond_timedwait 3 , + .Xr pthread_cond_broadcast 3 + .Sh STANDARDS + .Fn pthread_cond_signal + is expected to conform to IEEE + .Pq Dq Tn POSIX + Std 1003.1c when it is published. diff -cN man.old/pthread_cond_timedwait.3 man/pthread_cond_timedwait.3 *** man.old/pthread_cond_timedwait.3 Wed Dec 31 19:00:00 1969 --- man/pthread_cond_timedwait.3 Thu Jul 30 09:41:04 1998 *************** *** 0 **** --- 1,85 ---- + .\" Copyright (c) 1997 Brian Cully + .\" All rights reserved. + .\" + .\" Redistribution and use in source and binary forms, with or without + .\" modification, are permitted provided that the following conditions + .\" are met: + .\" 1. Redistributions of source code must retain the above copyright + .\" notice, this list of conditions and the following disclaimer. + .\" 2. Redistributions in binary form must reproduce the above copyright + .\" notice, this list of conditions and the following disclaimer in the + .\" documentation and/or other materials provided with the distribution. + .\" 3. Neither the name of the author nor the names of any co-contributors + .\" may be used to endorse or promote products derived from this software + .\" without specific prior written permission. + .\" + .\" THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL AND CONTRIBUTORS ``AS IS'' AND + .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + .\" SUCH DAMAGE. + .\" + .Dd July 28, 1998 + .Dt PTHREAD_COND_TIMEDWAIT 3 + .Os BSD 4 + .Sh NAME + .Nm pthread_cond_timedwait + .Nd wait on a condition variable for a specific amount of time + .Sh SYNOPSIS + .Fd #include + .Ft int + .Fn pthread_cond_timedwait "pthread_cond_t *cond" "pthread_mutex_t *mutex" "const struct timespec *abstime" + .Sh DESCRIPTION + The + .Fn pthread_cond_timedwait + function atomically blocks the current thread waiting on the condition + variable specified by + .Fa cond , + and unblocks the mutex specified by + .Fa mutex . + The waiting thread unblocks only after another thread calls + .Xr pthread_cond_signal 3 , + or + .Xr pthread_cond_broadcast 3 + with the same condition variable, or if the system time reaches the + time specified in + .Fa abstime , + and the current thread reaquires the lock on + .Fa mutex . + .Sh RETURN VALUES + If successful, the + .Fn pthread_cond_timedwait + function will return zero. Otherwise an error number will be returned to + indicate the error. + .Sh ERRORS + .Fn pthread_cond_timedwait + will fail if: + .Bl -tag -width Er + .It Bq Er EINVAL + The value specified by + .Fa cond + or the value specified by + .Fa attr + is invalid. + .It Bq Er ETIMEDOUT + The system time has reached or exceeded the time specified in + .Fa abstime . + .El + .Pp + .Sh SEE ALSO + .Xr pthread_cond_init 3 , + .Xr pthread_cond_destroy 3 , + .Xr pthread_cond_wait 3 , + .Xr pthread_cond_signal 3 , + .Xr pthread_cond_broadcast 3 + .Sh STANDARDS + .Fn pthread_cond_timedwait + is expected to conform to IEEE + .Pq Dq Tn POSIX + Std 1003.1c when it is published. diff -cN man.old/pthread_cond_wait.3 man/pthread_cond_wait.3 *** man.old/pthread_cond_wait.3 Wed Dec 31 19:00:00 1969 --- man/pthread_cond_wait.3 Thu Jul 30 09:41:19 1998 *************** *** 0 **** --- 1,79 ---- + .\" Copyright (c) 1997 Brian Cully + .\" All rights reserved. + .\" + .\" Redistribution and use in source and binary forms, with or without + .\" modification, are permitted provided that the following conditions + .\" are met: + .\" 1. Redistributions of source code must retain the above copyright + .\" notice, this list of conditions and the following disclaimer. + .\" 2. Redistributions in binary form must reproduce the above copyright + .\" notice, this list of conditions and the following disclaimer in the + .\" documentation and/or other materials provided with the distribution. + .\" 3. Neither the name of the author nor the names of any co-contributors + .\" may be used to endorse or promote products derived from this software + .\" without specific prior written permission. + .\" + .\" THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL AND CONTRIBUTORS ``AS IS'' AND + .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + .\" SUCH DAMAGE. + .\" + .Dd July 28, 1998 + .Dt PTHREAD_COND_WAIT 3 + .Os BSD 4 + .Sh NAME + .Nm pthread_cond_wait + .Nd wait on a condition variable + .Sh SYNOPSIS + .Fd #include + .Ft int + .Fn pthread_cond_wait "pthread_cond_t *cond" "pthread_mutex_t *mutex" + .Sh DESCRIPTION + The + .Fn pthread_cond_wait + function atomically blocks the current thread waiting on the condition + variable specified by + .Fa cond , + and unblocks the mutex specified by + .Fa mutex . + The waiting thread unblocks only after another thread calls + .Xr pthread_cond_signal 3 , or + .Xr pthread_cond_broadcast 3 + with the same condition variable, and the current thread reaquires the lock + on + .Fa mutex . + .Sh RETURN VALUES + If successful, the + .Fn pthread_cond_wait + function will return zero. Otherwise an error number will be returned to + indicate the error. + .Sh ERRORS + .Fn pthread_cond_wait + will fail if: + .Bl -tag -width Er + .It Bq Er EINVAL + The value specified by + .Fa cond + or the value specified by + .Fa attr + is invalid. + .El + .Pp + .Sh SEE ALSO + .Xr pthread_cond_init 3 , + .Xr pthread_cond_destroy 3 , + .Xr pthread_cond_timedwait 3 , + .Xr pthread_cond_signal 3 , + .Xr pthread_cond_broadcast 3 + .Sh STANDARDS + .Fn pthread_cond_wait + is expected to conform to IEEE + .Pq Dq Tn POSIX + Std 1003.1c when it is published. diff -cN man.old/pthread_create.3 man/pthread_create.3 *** man.old/pthread_create.3 Thu Jul 30 11:30:03 1998 --- man/pthread_create.3 Thu Jul 30 09:38:08 1998 *************** *** 102,107 **** --- 102,109 ---- .Sh SEE ALSO .Xr fork 2 , .Xr pthread_exit 3 , + .Xr pthread_cleanup_push 3 , + .Xr pthread_cleanup_pop 3 , .Xr pthread_join 3 .Sh STANDARDS .Fn pthread_create diff -cN man.old/pthread_mutex_destroy.3 man/pthread_mutex_destroy.3 *** man.old/pthread_mutex_destroy.3 Wed Dec 31 19:00:00 1969 --- man/pthread_mutex_destroy.3 Thu Jul 30 09:41:37 1998 *************** *** 0 **** --- 1,70 ---- + .\" Copyright (c) 1997 Brian Cully + .\" All rights reserved. + .\" + .\" Redistribution and use in source and binary forms, with or without + .\" modification, are permitted provided that the following conditions + .\" are met: + .\" 1. Redistributions of source code must retain the above copyright + .\" notice, this list of conditions and the following disclaimer. + .\" 2. Redistributions in binary form must reproduce the above copyright + .\" notice, this list of conditions and the following disclaimer in the + .\" documentation and/or other materials provided with the distribution. + .\" 3. Neither the name of the author nor the names of any co-contributors + .\" may be used to endorse or promote products derived from this software + .\" without specific prior written permission. + .\" + .\" THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL AND CONTRIBUTORS ``AS IS'' AND + .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + .\" SUCH DAMAGE. + .\" + .Dd July 29, 1998 + .Dt PTHREAD_MUTEX_DESTROY 3 + .Os BSD 4 + .Sh NAME + .Nm pthread_mutex_destroy + .Nd free resources allocated for a mutex + .Sh SYNOPSIS + .Fd #include + .Ft int + .Fn pthread_mutex_destroy "pthread_mutex_t *mutex" + .Sh DESCRIPTION + The + .Fn pthread_mutex_destroy + function frees the resources allocated for + .Fa mutex . + .Sh RETURN VALUES + If successful, + .Fn pthread_mutex_destroy + will return zero, otherwise an error number will be returned to + indicate the error. + .Sh ERRORS + .Fn pthread_mutex_destroy + will fail if: + .Bl -tag -width Er + .It Bq Er EINVAL + The value specified by + .Fa mutex + is invalid. + .It Bq Er EBUSY + .Fa Mutex + is locked by another thread. + .El + .Pp + .Sh SEE ALSO + .Xr pthread_mutex_init 3 , + .Xr pthread_mutex_lock 3 , + .Xr pthread_mutex_unlock 3 , + .Xr pthread_mutex_trylock 3 + .Sh STANDARDS + .Fn pthread_mutex_destroy + is expected to conform to IEEE + .Pq Dq Tn POSIX + Std 1003.1c when it is published. diff -cN man.old/pthread_mutex_init.3 man/pthread_mutex_init.3 *** man.old/pthread_mutex_init.3 Wed Dec 31 19:00:00 1969 --- man/pthread_mutex_init.3 Thu Jul 30 09:42:07 1998 *************** *** 0 **** --- 1,75 ---- + .\" Copyright (c) 1997 Brian Cully + .\" All rights reserved. + .\" + .\" Redistribution and use in source and binary forms, with or without + .\" modification, are permitted provided that the following conditions + .\" are met: + .\" 1. Redistributions of source code must retain the above copyright + .\" notice, this list of conditions and the following disclaimer. + .\" 2. Redistributions in binary form must reproduce the above copyright + .\" notice, this list of conditions and the following disclaimer in the + .\" documentation and/or other materials provided with the distribution. + .\" 3. Neither the name of the author nor the names of any co-contributors + .\" may be used to endorse or promote products derived from this software + .\" without specific prior written permission. + .\" + .\" THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL AND CONTRIBUTORS ``AS IS'' AND + .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + .\" SUCH DAMAGE. + .\" + .Dd July 29, 1998 + .Dt PTHREAD_MUTEX_INIT 3 + .Os BSD 4 + .Sh NAME + .Nm pthread_mutex_init + .Nd create a mutex + .Sh SYNOPSIS + .Fd #include + .Ft int + .Fn pthread_mutex_init "pthread_mutex_t *mutex" "pthread_mutexattr_t *attr" + .Sh DESCRIPTION + The + .Fn pthread_mutex_init + function creates a new mutex, with attributes specified with + .Fa attr . + If + .Fa attr + is NULL the default attributes are used. + .Sh RETURN VALUES + If successful, + .Fn pthread_mutex_init + will return zero and put the new mutex id into + .Fa mutex , + otherwise an error number will be returned to indicate the error. + .Sh ERRORS + .Fn pthread_mutex_init + will fail if: + .Bl -tag -width Er + .It Bq Er EINVAL + The value specified by + .Fa attr + is invalid. + .It Bq Er ENOMEM + The process cannot allocate enough memory to create another mutex. + .It Bq Er EAGAIN + The temporarily lacks the resources to create another mutex. + .El + .Pp + .Sh SEE ALSO + .Xr pthread_mutex_destroy 3 , + .Xr pthread_mutex_lock 3 , + .Xr pthread_mutex_unlock 3 , + .Xr pthread_mutex_trylock 3 + .Sh STANDARDS + .Fn pthread_mutex_init + is expected to conform to IEEE + .Pq Dq Tn POSIX + Std 1003.1c when it is published. diff -cN man.old/pthread_mutex_lock.3 man/pthread_mutex_lock.3 *** man.old/pthread_mutex_lock.3 Wed Dec 31 19:00:00 1969 --- man/pthread_mutex_lock.3 Thu Jul 30 09:42:16 1998 *************** *** 0 **** --- 1,72 ---- + .\" Copyright (c) 1997 Brian Cully + .\" All rights reserved. + .\" + .\" Redistribution and use in source and binary forms, with or without + .\" modification, are permitted provided that the following conditions + .\" are met: + .\" 1. Redistributions of source code must retain the above copyright + .\" notice, this list of conditions and the following disclaimer. + .\" 2. Redistributions in binary form must reproduce the above copyright + .\" notice, this list of conditions and the following disclaimer in the + .\" documentation and/or other materials provided with the distribution. + .\" 3. Neither the name of the author nor the names of any co-contributors + .\" may be used to endorse or promote products derived from this software + .\" without specific prior written permission. + .\" + .\" THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL AND CONTRIBUTORS ``AS IS'' AND + .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + .\" SUCH DAMAGE. + .\" + .Dd July 30, 1998 + .Dt PTHREAD_MUTEX_LOCK 3 + .Os BSD 4 + .Sh NAME + .Nm pthread_mutex_lock + .Nd lock a mutex + .Sh SYNOPSIS + .Fd #include + .Ft int + .Fn pthread_mutex_lock "pthread_mutex_t *mutex" + .Sh DESCRIPTION + The + .Fn pthread_mutex_lock + function locks + .Fa mutex . + If the mutex is already locked, the calling thread will block until the + mutex becomes available. + .Sh RETURN VALUES + If successful, + .Fn pthread_mutex_lock + will return zero, otherwise an error number will be returned to + indicate the error. + .Sh ERRORS + .Fn pthread_mutex_lock + will fail if: + .Bl -tag -width Er + .It Bq Er EINVAL + The value specified by + .Fa mutex + is invalid. + .It Bq Er EDEADLK + A deadlock would occur if the thread blocked waiting for + .Fa mutex . + .El + .Pp + .Sh SEE ALSO + .Xr pthread_mutex_unlock 3 , + .Xr pthread_mutex_trylock 3 , + .Xr pthread_mutex_init 3 , + .Xr pthread_mutex_destroy 3 + .Sh STANDARDS + .Fn pthread_mutex_lock + is expected to conform to IEEE + .Pq Dq Tn POSIX + Std 1003.1c when it is published. diff -cN man.old/pthread_mutex_trylock.3 man/pthread_mutex_trylock.3 *** man.old/pthread_mutex_trylock.3 Wed Dec 31 19:00:00 1969 --- man/pthread_mutex_trylock.3 Thu Jul 30 09:42:30 1998 *************** *** 0 **** --- 1,73 ---- + .\" Copyright (c) 1997 Brian Cully + .\" All rights reserved. + .\" + .\" Redistribution and use in source and binary forms, with or without + .\" modification, are permitted provided that the following conditions + .\" are met: + .\" 1. Redistributions of source code must retain the above copyright + .\" notice, this list of conditions and the following disclaimer. + .\" 2. Redistributions in binary form must reproduce the above copyright + .\" notice, this list of conditions and the following disclaimer in the + .\" documentation and/or other materials provided with the distribution. + .\" 3. Neither the name of the author nor the names of any co-contributors + .\" may be used to endorse or promote products derived from this software + .\" without specific prior written permission. + .\" + .\" THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL AND CONTRIBUTORS ``AS IS'' AND + .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + .\" SUCH DAMAGE. + .\" + .Dd July 30, 1998 + .Dt PTHREAD_MUTEX_TRYLOCK 3 + .Os BSD 4 + .Sh NAME + .Nm pthread_mutex_trylock + .Nd attempt to lock a mutex without blocking + .Sh SYNOPSIS + .Fd #include + .Ft int + .Fn pthread_mutex_trylock "pthread_mutex_t *mutex" + .Sh DESCRIPTION + The + .Fn pthread_mutex_trylock + function locks + .Fa mutex . + If the mutex is already locked, + .Fn pthread_mutex_trylock + will not block waiting for the mutex, but will return an error condition. + .Sh RETURN VALUES + If successful, + .Fn pthread_mutex_trylock + will return zero, otherwise an error number will be returned to + indicate the error. + .Sh ERRORS + .Fn pthread_mutex_trylock + will fail if: + .Bl -tag -width Er + .It Bq Er EINVAL + The value specified by + .Fa mutex + is invalid. + .It Bq Er EBUSY + .Fa Mutex + is already locked. + .El + .Pp + .Sh SEE ALSO + .Xr pthread_mutex_lock 3 , + .Xr pthread_mutex_unlock 3 , + .Xr pthread_mutex_init 3 , + .Xr pthread_mutex_destroy 3 + .Sh STANDARDS + .Fn pthread_mutex_trylock + is expected to conform to IEEE + .Pq Dq Tn POSIX + Std 1003.1c when it is published. diff -cN man.old/pthread_mutex_unlock.3 man/pthread_mutex_unlock.3 *** man.old/pthread_mutex_unlock.3 Wed Dec 31 19:00:00 1969 --- man/pthread_mutex_unlock.3 Thu Jul 30 09:42:39 1998 *************** *** 0 **** --- 1,72 ---- + .\" Copyright (c) 1997 Brian Cully + .\" All rights reserved. + .\" + .\" Redistribution and use in source and binary forms, with or without + .\" modification, are permitted provided that the following conditions + .\" are met: + .\" 1. Redistributions of source code must retain the above copyright + .\" notice, this list of conditions and the following disclaimer. + .\" 2. Redistributions in binary form must reproduce the above copyright + .\" notice, this list of conditions and the following disclaimer in the + .\" documentation and/or other materials provided with the distribution. + .\" 3. Neither the name of the author nor the names of any co-contributors + .\" may be used to endorse or promote products derived from this software + .\" without specific prior written permission. + .\" + .\" THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL AND CONTRIBUTORS ``AS IS'' AND + .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + .\" SUCH DAMAGE. + .\" + .Dd July 30, 1998 + .Dt PTHREAD_MUTEX_UNLOCK 3 + .Os BSD 4 + .Sh NAME + .Nm pthread_mutex_unlock + .Nd unlock a mutex + .Sh SYNOPSIS + .Fd #include + .Ft int + .Fn pthread_mutex_unlock "pthread_mutex_t *mutex" + .Sh DESCRIPTION + If the current thread holds the lock on + .Fa mutex , + then the + .Fn pthread_mutex_unlock + function unlocks + .Fa mutex . + .Sh RETURN VALUES + If successful, + .Fn pthread_mutex_unlock + will return zero, otherwise an error number will be returned to + indicate the error. + .Sh ERRORS + .Fn pthread_mutex_trylock + will fail if: + .Bl -tag -width Er + .It Bq Er EINVAL + The value specified by + .Fa mutex + is invalid. + .It Bq Er EPERM + The current thread does not hold a lock on + .Fa mutex . + .El + .Pp + .Sh SEE ALSO + .Xr pthread_mutex_lock 3 , + .Xr pthread_mutex_trylock 3 , + .Xr pthread_mutex_init 3 , + .Xr pthread_mutex_destroy 3 + .Sh STANDARDS + .Fn pthread_mutex_unlock + is expected to conform to IEEE + .Pq Dq Tn POSIX + Std 1003.1c when it is published. >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-doc" in the body of the message