Index: stable/10/lib/libthr/libthr.3 =================================================================== --- stable/10/lib/libthr/libthr.3 (revision 302009) +++ stable/10/lib/libthr/libthr.3 (revision 302010) @@ -1,261 +1,259 @@ .\" Copyright (c) 2005 Robert N. M. Watson .\" Copyright (c) 2014,2015 The FreeBSD Foundation, Inc. .\" All rights reserved. .\" .\" Part of this documentation was written by .\" Konstantin Belousov under sponsorship .\" from the FreeBSD Foundation. .\" .\" 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. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS 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 AUTHORS 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. .\" .\" $FreeBSD$ .\" .Dd February 12, 2015 .Dt LIBTHR 3 .Os .Sh NAME .Nm libthr .Nd "1:1 POSIX threads library" .Sh LIBRARY .Lb libthr .Sh SYNOPSIS .In pthread.h .Sh DESCRIPTION The .Nm library provides a 1:1 implementation of the .Xr pthread 3 library interfaces for application threading. It has been optimized for use by applications expecting system scope thread -semantics, and can provide significant performance improvements -compared to -.Lb libkse . +semantics. .Pp The library is tightly integrated with the run-time link editor .Xr ld-elf.so.1 1 and .Lb libc ; all three components must be built from the same source tree. Mixing .Li libc and .Nm libraries from different versions of .Fx is not supported. The run-time linker .Xr ld-elf.so.1 1 has some code to ensure backward-compatibility with older versions of .Nm . .Pp The man page documents the quirks and tunables of the .Nm . When linking with .Li -lpthread , the run-time dependency .Li libthr.so.3 is recorded in the produced object. .Sh MUTEX ACQUISITION A locked mutex (see .Xr pthread_mutex_lock 3 ) is represented by a volatile variable of type .Dv lwpid_t , which records the global system identifier of the thread owning the lock. .Nm performs a contested mutex acquisition in three stages, each of which is more resource-consuming than the previous. The first two stages are only applied for a mutex of .Dv PTHREAD_MUTEX_ADAPTIVE_NP type and .Dv PTHREAD_PRIO_NONE protocol (see .Xr pthread_mutexattr 3 ) . .Pp First, on SMP systems, a spin loop is performed, where the library attempts to acquire the lock by .Xr atomic 9 operations. The loop count is controlled by the .Ev LIBPTHREAD_SPINLOOPS environment variable, with a default value of 2000. .Pp If the spin loop was unable to acquire the mutex, a yield loop is executed, performing the same .Xr atomic 9 acquisition attempts as the spin loop, but each attempt is followed by a yield of the CPU time of the thread using the .Xr sched_yield 2 syscall. By default, the yield loop is not executed. This is controlled by the .Ev LIBPTHREAD_YIELDLOOPS environment variable. .Pp If both the spin and yield loops failed to acquire the lock, the thread is taken off the CPU and put to sleep in the kernel with the .Xr umtx 2 syscall. The kernel wakes up a thread and hands the ownership of the lock to the woken thread when the lock becomes available. .Sh THREAD STACKS Each thread is provided with a private user-mode stack area used by the C runtime. The size of the main (initial) thread stack is set by the kernel, and is controlled by the .Dv RLIMIT_STACK process resource limit (see .Xr getrlimit 2 ) . .Pp By default, the main thread's stack size is equal to the value of .Dv RLIMIT_STACK for the process. If the .Ev LIBPTHREAD_SPLITSTACK_MAIN environment variable is present in the process environment (its value does not matter), the main thread's stack is reduced to 4MB on 64bit architectures, and to 2MB on 32bit architectures, when the threading library is initialized. The rest of the address space area which has been reserved by the kernel for the initial process stack is used for non-initial thread stacks in this case. The presence of the .Ev LIBPTHREAD_BIGSTACK_MAIN environment variable overrides .Ev LIBPTHREAD_SPLITSTACK_MAIN ; it is kept for backward-compatibility. .Pp The size of stacks for threads created by the process at run-time with the .Xr pthread_create 3 call is controlled by thread attributes: see .Xr pthread_attr 3 , in particular, the .Xr pthread_attr_setstacksize 3 , .Xr pthread_attr_setguardsize 3 and .Xr pthread_attr_setstackaddr 3 functions. If no attributes for the thread stack size are specified, the default non-initial thread stack size is 2MB for 64bit architectures, and 1MB for 32bit architectures. .Sh RUN-TIME SETTINGS The following environment variables are recognized by .Nm and adjust the operation of the library at run-time: .Bl -tag -width LIBPTHREAD_SPLITSTACK_MAIN .It Ev LIBPTHREAD_BIGSTACK_MAIN Disables the reduction of the initial thread stack enabled by .Ev LIBPTHREAD_SPLITSTACK_MAIN . .It Ev LIBPTHREAD_SPLITSTACK_MAIN Causes a reduction of the initial thread stack, as described in the section .Sx THREAD STACKS . This was the default behaviour of .Nm before .Fx 11.0 . .It Ev LIBPTHREAD_SPINLOOPS The integer value of the variable overrides the default count of iterations in the .Li spin loop of the mutex acquisition. The default count is 2000, set by the .Dv MUTEX_ADAPTIVE_SPINS constant in the .Nm sources. .It Ev LIBPTHREAD_YIELDLOOPS A non-zero integer value enables the yield loop in the process of the mutex acquisition. The value is the count of loop operations. .It Ev LIBPTHREAD_QUEUE_FIFO The integer value of the variable specifies how often blocked threads are inserted at the head of the sleep queue, instead of its tail. Bigger values reduce the frequency of the FIFO discipline. The value must be between 0 and 255. .El .Sh INTERACTION WITH RUN-TIME LINKER On load, .Nm installs interposing handlers into the hooks exported by .Li libc . The interposers provide real locking implementation instead of the stubs for single-threaded processes in .Li , cancellation support and some modifications to the signal operations. .Pp .Nm cannot be unloaded; the .Xr dlclose 3 function does not perform any action when called with a handle for .Nm . One of the reasons is that the internal interposing of .Li libc functions cannot be undone. .Sh SIGNALS The implementation interposes the user-installed .Xr signal 3 handlers. This interposing is done to postpone signal delivery to threads which entered (libthr-internal) critical sections, where the calling of the user-provided signal handler is unsafe. An example of such a situation is owning the internal library lock. When a signal is delivered while the signal handler cannot be safely called, the call is postponed and performed until after the exit from the critical section. This should be taken into account when interpreting .Xr ktrace 1 logs. .Sh SEE ALSO .Xr ktrace 1 , .Xr ld-elf.so.1 1 , .Xr getrlimit 2 , .Xr umtx 2 , .Xr dlclose 3 , .Xr dlopen 3 , .Xr errno 3 , .Xr getenv 3 , .Xr libc 3 , .Xr pthread_attr 3 , .Xr pthread_attr_setstacksize 3 , .Xr pthread_create 3 , .Xr signal 3 , .Xr atomic 9 .Sh AUTHORS .An -nosplit The .Nm library was originally created by .An "Jeff Roberson" Aq jeff@FreeBSD.org , and enhanced by .An "Jonathan Mini" Aq mini@FreeBSD.org and .An "Mike Makonnen" Aq mtm@FreeBSD.org . It has been substantially rewritten and optimized by .An "David Xu" Aq davidxu@FreeBSD.org . Index: stable/10/share/man/man3/pthread_barrier_destroy.3 =================================================================== --- stable/10/share/man/man3/pthread_barrier_destroy.3 (revision 302009) +++ stable/10/share/man/man3/pthread_barrier_destroy.3 (revision 302010) @@ -1,158 +1,156 @@ .\" Copyright (c) 2004 Michael Telahun Makonnen .\" 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. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. .\" .\" $FreeBSD$ .\" .Dd February 19, 2004 .Dt PTHREAD_BARRIER 3 .Os .Sh NAME .Nm pthread_barrier_destroy , pthread_barrier_init , pthread_barrier_wait .Nd "destroy, initialize or wait on a barrier object" .Sh LIBRARY .Lb libpthread .Sh SYNOPSIS .In pthread.h .Ft int .Fn pthread_barrier_destroy "pthread_barrier_t *barrier" .Ft int .Fn pthread_barrier_init "pthread_barrier_t *barrier" "const pthread_barrierattr_t *attr" "unsigned count" .Ft int .Fn pthread_barrier_wait "pthread_barrier_t *barrier" .Sh DESCRIPTION The .Fn pthread_barrier_init function will initialize .Fa barrier with attributes specified in .Fa attr , or if it is .Dv NULL , with default attributes. The number of threads that must call .Fn pthread_barrier_wait before any of the waiting threads can be released is specified by .Fa count . The .Fn pthread_barrier_destroy function will destroy .Fa barrier and release any resources that may have been allocated on its behalf. .Pp The .Fn pthread_barrier_wait function will synchronize calling threads at .Fa barrier . The threads will be blocked from making further progress until a sufficient number of threads calls this function. The number of threads that must call it before any of them will be released is determined by the .Fa count argument to .Fn pthread_barrier_init . Once the threads have been released the barrier will be reset. .Sh IMPLEMENTATION NOTES -In both -.Lb libkse -and +In .Lb libthr the .Dv PTHREAD_BARRIER_SERIAL_THREAD return value will always be returned by the last thread to reach the barrier. .Sh RETURN VALUES If successful, both .Fn pthread_barrier_destroy and .Fn pthread_barrier_init will return zero. Otherwise, an error number will be returned to indicate the error. If the call to .Fn pthread_barrier_wait is successful, all but one of the threads will return zero. That one thread will return .Dv PTHREAD_BARRIER_SERIAL_THREAD . Otherwise, an error number will be returned to indicate the error. .Pp None of these functions will return .Er EINTR . .Sh ERRORS The .Fn pthread_barrier_destroy function will fail if: .Bl -tag -width Er .It Bq Er EBUSY An attempt was made to destroy .Fa barrier while it was in use. .El .Pp The .Fn pthread_barrier_destroy and .Fn pthread_barrier_wait functions may fail if: .Bl -tag -width Er .It Bq Er EINVAL The value specified by .Fa barrier is invalid. .El .Pp The .Fn pthread_barrier_init function will fail if: .Bl -tag -width Er .It Bq Er EAGAIN The system lacks resources, other than memory, to initialize .Fa barrier . .It Bq Er EINVAL The .Fa count argument is less than 1. .It Bq Er ENOMEM Insufficient memory to initialize .Fa barrier . .El .Sh SEE ALSO .Xr pthread_barrierattr 3 .Sh HISTORY The .Fn pthread_barrier_destroy , .Fn pthread_barrier_init and .Fn pthread_barrier_wait functions first appeared in .Lb libkse in .Fx 5.2 , and in .Lb libthr in .Fx 5.3 . Index: stable/10/share/man/man3/pthread_barrierattr.3 =================================================================== --- stable/10/share/man/man3/pthread_barrierattr.3 (revision 302009) +++ stable/10/share/man/man3/pthread_barrierattr.3 (revision 302010) @@ -1,148 +1,146 @@ .\" Copyright (c) 2004 Michael Telahun Makonnen .\" 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. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. .\" .\" $FreeBSD$ .\" .Dd February 19, 2004 .Dt PTHREAD_BARRIERATTR 3 .Os .Sh NAME .Nm pthread_barrierattr_destroy , pthread_barrierattr_getpshared , .Nm pthread_barrierattr_init , pthread_barrierattr_setpshared .Nd "manipulate a barrier attribute object" .Sh LIBRARY .Lb libpthread .Sh SYNOPSIS .In pthread.h .Ft int .Fn pthread_barrierattr_destroy "pthread_barrierattr_t *attr" .Ft int .Fn pthread_barrierattr_getpshared "const pthread_barrierattr_t *attr" "int *pshared" .Ft int .Fn pthread_barrierattr_init "pthread_barrierattr_t *attr" .Ft int .Fn pthread_barrierattr_setpshared "pthread_barrierattr_t *attr" "int pshared" .Sh DESCRIPTION The .Fn pthread_barrierattr_init function will initialize .Fa attr with default attributes. The .Fn pthread_barrierattr_destroy function will destroy .Fa attr and release any resources that may have been allocated on its behalf. .Pp The .Fn pthread_barrierattr_getpshared function will put the value of the process-shared attribute from .Fa attr into the memory area pointed to by .Fa pshared . The .Fn pthread_barrierattr_setpshared function will set the process-shared attribute of .Fa attr to the value specified in .Fa pshared . The argument .Fa pshared may have one of the following values: .Bl -tag -width ".Dv PTHREAD_PROCESS_PRIVATE" .It Dv PTHREAD_PROCESS_PRIVATE The barrier object it is attached to may only be accessed by threads in the same process as the one that created the object. .It Dv PTHREAD_PROCESS_SHARED The barrier object it is attached to may be accessed by threads in processes other than the one that created the object. .El .Sh RETURN VALUES If successful, all these functions will return zero. Otherwise, an error number will be returned to indicate the error. .Pp None of these functions will return .Er EINTR . .Sh ERRORS The .Fn pthread_barrierattr_destroy , .Fn pthread_barrierattr_getpshared and .Fn pthread_barrierattr_setpshared functions may fail if: .Bl -tag -width Er .It Bq Er EINVAL The value specified by .Fa attr is invalid. .El .Pp The .Fn pthread_barrierattr_init function will fail if: .Bl -tag -width Er .It Bq Er ENOMEM Insufficient memory to initialize the barrier attribute object .Fa attr . .El .Pp The .Fn pthread_barrierattr_setpshared function will fail if: .Bl -tag -width Er .It Bq Er EINVAL The value specified in .Fa pshared is not one of the allowed values. .El .Sh SEE ALSO .Xr pthread_barrier_destroy 3 , .Xr pthread_barrier_init 3 , .Xr pthread_barrier_wait 3 .Sh HISTORY The .Fn pthread_barrierattr_* functions first appeared in .Lb libkse in .Fx 5.2 , and in .Lb libthr in .Fx 5.3 . .Sh BUGS The implementation of barriers does not fully conform to .St -p1003.2 because the process-shared attribute is ignored in -.Lb libthr , -and in -.Lb libkse ; +.Lb libthr ; if any value other than -.Dv PTHREAD_PROCESSES_PRIVATE +.Dv PTHREAD_PROCESS_PRIVATE is specified in a call to .Fn pthread_barrierattr_setpshared , it will return .Er EINVAL . Index: stable/10/share/man/man3/pthread_condattr.3 =================================================================== --- stable/10/share/man/man3/pthread_condattr.3 (revision 302009) +++ stable/10/share/man/man3/pthread_condattr.3 (revision 302010) @@ -1,174 +1,174 @@ .\" Copyright (C) 2000 Jason Evans . .\" 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(s), this list of conditions and the following disclaimer as .\" the first lines of this file unmodified other than the possible .\" addition of one or more copyright notices. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice(s), this list of conditions and the following disclaimer in .\" the documentation and/or other materials provided with the .\" distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``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 COPYRIGHT HOLDER(S) 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. .\" .\" $FreeBSD$ .Dd May 9, 2010 .Dt PTHREAD_CONDATTR 3 .Os .Sh NAME .Nm pthread_condattr_init , .Nm pthread_condattr_destroy , .Nm pthread_condattr_getclock , .Nm pthread_condattr_setclock , .Nm pthread_condattr_getpshared , .Nm pthread_condattr_setpshared .Nd condition attribute operations .Sh LIBRARY .Lb libpthread .Sh SYNOPSIS .In pthread.h .Ft int .Fn pthread_condattr_init "pthread_condattr_t *attr" .Ft int .Fn pthread_condattr_destroy "pthread_condattr_t *attr" .Ft int .Fn pthread_condattr_getclock "pthread_condattr_t * restrict attr" "clock_t * restrict clock_id" .Ft int .Fn pthread_condattr_setclock "pthread_condattr_t *attr" "clock_t clock_id" .Ft int .Fn pthread_condattr_getpshared "pthread_condattr_t * restrict attr" "int * restrict pshared" .Ft int .Fn pthread_condattr_setpshared "pthread_condattr_t *attr" "int pshared" .Sh DESCRIPTION Condition attribute objects are used to specify parameters to .Fn pthread_cond_init . .Pp The .Fn pthread_condattr_init function initializes a condition attribute object with the default attributes. .Pp The .Fn pthread_condattr_destroy function destroys a condition attribute object. .Pp The .Fn pthread_condattr_getclock function will put the value of the clock attribute from .Fa attr into the memory area pointed to by .Fa clock_id . The .Fn pthread_condattr_setclock function will set the clock attribute of .Fa attr to the value specified in .Fa clock_id . The clock attribute affects the interpretation of .Fa abstime in .Xr pthread_cond_timedwait 3 and may be set to .Dv CLOCK_REALTIME (default) or .Dv CLOCK_MONOTONIC . .Pp The .Fn pthread_condattr_getpshared function will put the value of the process-shared attribute from .Fa attr into the memory area pointed to by .Fa pshared . The .Fn pthread_condattr_setpshared function will set the process-shared attribute of .Fa attr to the value specified in .Fa pshared . The argument .Fa pshared may have one of the following values: .Bl -tag -width ".Dv PTHREAD_PROCESS_PRIVATE" .It Dv PTHREAD_PROCESS_PRIVATE The condition variable it is attached to may only be accessed by threads in the same process as the one that created the object. .It Dv PTHREAD_PROCESS_SHARED The condition variable it is attached to may be accessed by threads in processes other than the one that created the object. .El .Sh RETURN VALUES If successful, these functions return 0. Otherwise, an error number is returned to indicate the error. .Sh ERRORS The .Fn pthread_condattr_init function will fail if: .Bl -tag -width Er .It Bq Er ENOMEM Out of memory. .El .Pp The .Fn pthread_condattr_destroy function will fail if: .Bl -tag -width Er .It Bq Er EINVAL Invalid value for .Fa attr . .El .Pp The .Fn pthread_condattr_setclock function will fail if: .Bl -tag -width Er .It Bq Er EINVAL The value specified in .Fa clock_id is not one of the allowed values. .El .Pp The .Fn pthread_condattr_setpshared function will fail if: .Bl -tag -width Er .It Bq Er EINVAL The value specified in .Fa pshared is not one of the allowed values. .El .Sh SEE ALSO .Xr pthread_cond_init 3 , .Xr pthread_cond_timedwait 3 .Sh STANDARDS The .Fn pthread_condattr_init and .Fn pthread_condattr_destroy functions conform to .St -p1003.1-96 .Sh BUGS The implementation of condition variables does not fully conform to .St -p1003.2 because the process-shared attribute is ignored; if any value other than -.Dv PTHREAD_PROCESSES_PRIVATE +.Dv PTHREAD_PROCESS_PRIVATE is specified in a call to .Fn pthread_condattr_setpshared , it will return .Er EINVAL . Index: stable/10/share/man/man3/pthread_spin_init.3 =================================================================== --- stable/10/share/man/man3/pthread_spin_init.3 (revision 302009) +++ stable/10/share/man/man3/pthread_spin_init.3 (revision 302010) @@ -1,138 +1,136 @@ .\" Copyright (c) 2004 Michael Telahun Makonnen .\" 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. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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. .\" .\" $FreeBSD$ .\" .Dd January 22, 2004 .Dt PTHREAD_SPIN_INIT 3 .Os .Sh NAME .Nm pthread_spin_init , pthread_spin_destroy .Nd "initialize or destroy a spin lock" .Sh LIBRARY .Lb libpthread .Sh SYNOPSIS .In pthread.h .Ft int .Fn pthread_spin_init "pthread_spinlock_t *lock" "int pshared" .Ft int .Fn pthread_spin_destroy "pthread_spinlock_t *lock" .Sh DESCRIPTION The .Fn pthread_spin_init function will initialize .Fa lock to an unlocked state and allocate any resources necessary to begin using it. If .Fa pshared is set to .Dv PTHREAD_PROCESS_SHARED , any thread, whether belonging to the process in which the spinlock was created or not, that has access to the memory area where .Fa lock resides, can use .Fa lock . If it is set to .Dv PTHREAD_PROCESS_PRIVATE , it can only be used by threads within the same process. .Pp The .Fn pthread_spin_destroy function will destroy .Fa lock and release any resources that may have been allocated on its behalf. .Sh RETURN VALUES If successful, both .Fn pthread_spin_init and .Fn pthread_spin_destroy will return zero. Otherwise, an error number will be returned to indicate the error. .Pp Neither of these functions will return .Er EINTR . .Sh ERRORS The .Fn pthread_spin_init and .Fn pthread_spin_destroy functions will fail if: .Bl -tag -width Er .It Bq Er EBUSY An attempt to initialize or destroy .Fa lock while it is in use. .It Bq Er EINVAL The value specified by .Fa lock is invalid. .El .Pp The .Fn pthread_spin_init function will fail if: .Bl -tag -width Er .It Bq Er EAGAIN Insufficient resources, other than memory, to initialize .Fa lock . .It Bq Er ENOMEM Insufficient memory to initialize .Fa lock . .El .Sh SEE ALSO .Xr pthread_spin_lock 3 , .Xr pthread_spin_unlock 3 .Sh HISTORY The .Fn pthread_spin_init and .Fn pthread_spin_destroy functions first appeared in .Lb libkse in .Fx 5.2 , and in .Lb libthr in .Fx 5.3 . .Sh BUGS The implementation of .Fn pthread_spin_init does not fully conform to .St -p1003.2 because the .Fa pshared argument is ignored in -.Lb libthr , -and in -.Lb libkse +.Lb libthr ; if any value other than -.Dv PTHREAD_PROCESSES_PRIVATE +.Dv PTHREAD_PROCESS_PRIVATE is specified, it returns .Er EINVAL . Index: stable/10 =================================================================== --- stable/10 (revision 302009) +++ stable/10 (revision 302010) Property changes on: stable/10 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /head:r300970