diff options
Diffstat (limited to 'lib/libpthread/man')
25 files changed, 176 insertions, 131 deletions
diff --git a/lib/libpthread/man/flockfile.3 b/lib/libpthread/man/flockfile.3 index cfcae20b8d5..83785f65e5f 100644 --- a/lib/libpthread/man/flockfile.3 +++ b/lib/libpthread/man/flockfile.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: flockfile.3,v 1.6 1999/07/07 10:50:05 aaron Exp $ +.\" $OpenBSD: flockfile.3,v 1.7 2002/05/01 08:03:30 mpech Exp $ .\" David Leonard <d@openbsd.org>, 1998. Public domain. .Dd August 20, 1998 .Dt FLOCKFILE 3 @@ -24,7 +24,8 @@ and .Fn funlockfile functions provide for explicit application-level locking of stdio .Ft "FILE *" -objects. These functions can be used by a thread to delineate a sequence +objects. +These functions can be used by a thread to delineate a sequence of I/O statements that are to be executed as a unit. .Pp The @@ -51,14 +52,17 @@ function. .Pp Logically, there is a lock count associated with each .Ft "FILE *" -object. This count is implicitly intialized to zero when the +object. +This count is implicitly intialized to zero when the .Ft "FILE *" -object is created. The +object is created. +The .Ft "FILE *" object is unlocked when the count is zero. When the count is positive, a single thread owns the .Ft "FILE *" -object. When the +object. +When the .Fn flockfile function is called, if the count is zero or if the count is positive and the caller owns the @@ -68,7 +72,8 @@ Otherwise, the calling thread is suspended, waiting for the count to return to zero. Each call to .Fn funlockfile -decrements the count. This allows matching calls to +decrements the count. +This allows matching calls to .Fn flockfile (or successful calls to .Fn ftrylockfile ) diff --git a/lib/libpthread/man/pthread_attr_init.3 b/lib/libpthread/man/pthread_attr_init.3 index 742012783a4..318b27d5a6b 100644 --- a/lib/libpthread/man/pthread_attr_init.3 +++ b/lib/libpthread/man/pthread_attr_init.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: pthread_attr_init.3,v 1.2 2000/04/12 21:48:02 aaron Exp $ +.\" $OpenBSD: pthread_attr_init.3,v 1.3 2002/05/01 08:03:30 mpech Exp $ .\" Manual page derived from TOG's UNIX98 documentation. .Dd January 6, 2000 .Dt PTHREAD_ATTR_INIT 3 @@ -25,8 +25,8 @@ attributes used by a given implementation. The resulting attribute object (possibly modified by setting individual attribute values), when used by .Xr pthread_create 3 , -defines the attributes of the thread created. A single attributes -object can be used in multiple simultaneous calls to +defines the attributes of the thread created. +A single attributes object can be used in multiple simultaneous calls to .Xr pthread_create 3 . .Pp The @@ -37,15 +37,16 @@ attributes object. An implementation may cause to set .Fa attr to an implementation-dependent -invalid value. The behaviour of using the attribute after it has +invalid value. +The behaviour of using the attribute after it has been destroyed is undefined. .Sh RETURN VALUE Upon successful completion, .Fn pthread_attr_init and .Fn pthread_attr_destroy -return a value of 0. Otherwise, an error -number is returned to indicate the error. +return a value of 0. +Otherwise, an error number is returned to indicate the error. .Sh ERRORS The .Fn pthread_attr_init diff --git a/lib/libpthread/man/pthread_attr_setdetachstate.3 b/lib/libpthread/man/pthread_attr_setdetachstate.3 index 408383879f0..1f0dfa45ef8 100644 --- a/lib/libpthread/man/pthread_attr_setdetachstate.3 +++ b/lib/libpthread/man/pthread_attr_setdetachstate.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: pthread_attr_setdetachstate.3,v 1.3 2001/08/06 10:42:26 mpech Exp $ +.\" $OpenBSD: pthread_attr_setdetachstate.3,v 1.4 2002/05/01 08:03:30 mpech Exp $ .\" Manual page derived from TOG's UNIX98 documentation. .Dd January 6, 2000 .Dt PTHREAD_ATTR_SETDETACHSTATE 3 @@ -17,7 +17,8 @@ The .Va detachstate attribute controls whether the thread is created in -a detached state. If the thread is created detached, then use of +a detached state. +If the thread is created detached, then use of the ID of the newly created thread by the .Xr pthread_detach 3 or @@ -51,7 +52,8 @@ using a value of causes all threads created with .Fa attr -to be in the joinable state. The default value of the +to be in the joinable state. +The default value of the .Va detachstate attribute is .Dv PTHREAD_CREATE_JOINABLE . diff --git a/lib/libpthread/man/pthread_attr_setstackaddr.3 b/lib/libpthread/man/pthread_attr_setstackaddr.3 index dec5d0fc999..7254e83cceb 100644 --- a/lib/libpthread/man/pthread_attr_setstackaddr.3 +++ b/lib/libpthread/man/pthread_attr_setstackaddr.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: pthread_attr_setstackaddr.3,v 1.3 2000/04/15 02:15:26 aaron Exp $ +.\" $OpenBSD: pthread_attr_setstackaddr.3,v 1.4 2002/05/01 08:03:30 mpech Exp $ .\" Manual page derived from TOG's UNIX98 documentation. .Dd January 6, 2000 .Dt PTHREAD_ATTR_SETSTACKADDR 3 @@ -28,8 +28,8 @@ object. The .Va stackaddr attribute specifies the location of storage to be -used for the created thread's stack. The size of the storage is at -least +used for the created thread's stack. +The size of the storage is at least .Dv PTHREAD_STACK_MIN . .Sh RETURN VALUE Upon successful completion, diff --git a/lib/libpthread/man/pthread_cancel.3 b/lib/libpthread/man/pthread_cancel.3 index d03467a8c73..1d9fad5c5ce 100644 --- a/lib/libpthread/man/pthread_cancel.3 +++ b/lib/libpthread/man/pthread_cancel.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: pthread_cancel.3,v 1.9 2002/02/21 20:12:19 fgsch Exp $ +.\" $OpenBSD: pthread_cancel.3,v 1.10 2002/05/01 08:03:30 mpech Exp $ .\" .Dd January 17, 1999 .Dt PTHREAD_CANCEL 3 @@ -15,11 +15,13 @@ The .Fn pthread_cancel function requests that .Fa thread -be cancelled. The target thread's cancelability state and type determines -when the cancellation takes effect. When the cancellation is acted on, -the cancellation cleanup handlers for +be cancelled. +The target thread's cancelability state and type determines +when the cancellation takes effect. +When the cancellation is acted on, the cancellation cleanup handlers for .Fa thread -are called. When the last cancellation cleanup handler returns, +are called. +When the last cancellation cleanup handler returns, the thread-specific data destructor functions will be called for .Fa thread . When the last destructor function returns, @@ -32,8 +34,8 @@ respect to the calling thread returning from .Pp A status of .Dv PTHREAD_CANCELED -is made available to any threads joining with the target. The symbolic -constant +is made available to any threads joining with the target. +The symbolic constant .Dv PTHREAD_CANCELED expands to a constant expression of type .Ft "(void *)" @@ -42,8 +44,8 @@ whose value matches no pointer to an object in memory nor the value .Sh RETURN VALUES If successful, the .Fn pthread_cancel -functions will return zero. Otherwise an error number will be returned to -indicate the error. +functions will return zero. +Otherwise an error number will be returned to indicate the error. .Sh ERRORS .Fn pthread_cancel will fail if: diff --git a/lib/libpthread/man/pthread_cleanup_pop.3 b/lib/libpthread/man/pthread_cleanup_pop.3 index c642070445a..ec6ebbb0f61 100644 --- a/lib/libpthread/man/pthread_cleanup_pop.3 +++ b/lib/libpthread/man/pthread_cleanup_pop.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: pthread_cleanup_pop.3,v 1.6 2002/02/21 20:12:19 fgsch Exp $ +.\" $OpenBSD: pthread_cleanup_pop.3,v 1.7 2002/05/01 08:03:30 mpech Exp $ .\" .\" Copyright (c) 1997 Brian Cully <shmit@kublai.com> .\" All rights reserved. @@ -45,8 +45,8 @@ The function pops the top cleanup routine off of the current thread's cleanup routine stack, and, if .Fa execute -is non-zero, it will execute the function. If there is no cleanup routine -then +is non-zero, it will execute the function. +If there is no cleanup routine then .Fn pthread_cleanup_pop does nothing. .Sh RETURN VALUES diff --git a/lib/libpthread/man/pthread_cond_timedwait.3 b/lib/libpthread/man/pthread_cond_timedwait.3 index 22c2df147a0..dc0db2b463b 100644 --- a/lib/libpthread/man/pthread_cond_timedwait.3 +++ b/lib/libpthread/man/pthread_cond_timedwait.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: pthread_cond_timedwait.3,v 1.7 2002/02/21 20:12:19 fgsch Exp $ +.\" $OpenBSD: pthread_cond_timedwait.3,v 1.8 2002/05/01 08:03:30 mpech Exp $ .\" .\" Copyright (c) 1997 Brian Cully <shmit@kublai.com> .\" All rights reserved. @@ -59,8 +59,8 @@ and the current thread reaquires the lock on .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. +function will return zero. +Otherwise an error number will be returned to indicate the error. .Sh ERRORS .Fn pthread_cond_timedwait will fail if: diff --git a/lib/libpthread/man/pthread_cond_wait.3 b/lib/libpthread/man/pthread_cond_wait.3 index 70fe207baf4..a9158c1a554 100644 --- a/lib/libpthread/man/pthread_cond_wait.3 +++ b/lib/libpthread/man/pthread_cond_wait.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: pthread_cond_wait.3,v 1.7 2002/02/21 20:12:19 fgsch Exp $ +.\" $OpenBSD: pthread_cond_wait.3,v 1.8 2002/05/01 08:03:30 mpech Exp $ .\" .\" Copyright (c) 1997 Brian Cully <shmit@kublai.com> .\" All rights reserved. @@ -48,7 +48,8 @@ variable specified by 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_signal 3 , +or .Xr pthread_cond_broadcast 3 with the same condition variable, and the current thread reacquires the lock on @@ -56,8 +57,8 @@ on .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. +function will return zero. +Otherwise an error number will be returned to indicate the error. .Sh ERRORS .Fn pthread_cond_wait will fail if: diff --git a/lib/libpthread/man/pthread_create.3 b/lib/libpthread/man/pthread_create.3 index 8bae34329dc..71eeb0ee11d 100644 --- a/lib/libpthread/man/pthread_create.3 +++ b/lib/libpthread/man/pthread_create.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: pthread_create.3,v 1.8 2002/02/21 20:12:19 fgsch Exp $ +.\" $OpenBSD: pthread_create.3,v 1.9 2002/05/01 08:03:30 mpech Exp $ .\" .\" Copyright (c) 1996 John Birrell <jb@cimlogic.com.au>. .\" All rights reserved. @@ -47,12 +47,13 @@ The .Fn pthread_create function is used to create a new thread, with attributes specified by .Fa attr , -within a process. If +within a process. +If .Fa attr is NULL, the default attributes are used. If the attributes specified by .Fa attr -are modified later, the thread's attributes are not affected. Upon -successful completion +are modified later, the thread's attributes are not affected. +Upon successful completion .Fn pthread_create will store the ID of the created thread in the location specified by .Fa thread . @@ -61,15 +62,18 @@ The thread is created executing .Fa start_routine with .Fa arg -as its sole argument. If the +as its sole argument. +If the .Fa start_routine returns, the effect is as if there was an implicit call to .Fn pthread_exit using the return value of .Fa start_routine -as the exit status. Note that the thread in which +as the exit status. +Note that the thread in which .Fn main -was originally invoked differs from this. When it returns from +was originally invoked differs from this. +When it returns from .Fn main , the effect is as if there was an implicit call to .Fn exit @@ -87,8 +91,8 @@ The set of signals pending for the new thread is empty. .Sh RETURN VALUES If successful, the .Fn pthread_create -function will return zero. Otherwise an error number will be returned to -indicate the error. +function will return zero. +Otherwise an error number will be returned to indicate the error. .Sh ERRORS .Fn pthread_create will fail if: diff --git a/lib/libpthread/man/pthread_detach.3 b/lib/libpthread/man/pthread_detach.3 index 4aa837643aa..cd30b2c6e7b 100644 --- a/lib/libpthread/man/pthread_detach.3 +++ b/lib/libpthread/man/pthread_detach.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: pthread_detach.3,v 1.9 2002/02/21 20:12:19 fgsch Exp $ +.\" $OpenBSD: pthread_detach.3,v 1.10 2002/05/01 08:03:30 mpech Exp $ .\" .\" Copyright (c) 1996-1998 John Birrell <jb@cimlogic.com.au>. .\" All rights reserved. @@ -48,22 +48,26 @@ The function is used to indicate to the implementation that storage for the thread .Fa thread -can be reclaimed when the thread terminates. If +can be reclaimed when the thread terminates. +If .Fa thread has not terminated, .Fn pthread_detach -will not cause it to terminate. The effect of multiple +will not cause it to terminate. +The effect of multiple .Fn pthread_detach calls on the same target thread is unspecified. .Sh RETURN VALUES If successful, the .Fn pthread_detach -function will return zero. Otherwise an error number will be returned to -indicate the error. Note that the function does not change the value +function will return zero. +Otherwise an error number will be returned to indicate the error. +Note that the function does not change the value of .Va errno -as it did for some drafts of the standard. These early drafts -also passed a pointer to pthread_t as the argument. Beware! +as it did for some drafts of the standard. +These early drafts also passed a pointer to pthread_t as the argument. +Beware! .Sh ERRORS .Fn pthread_detach will fail if: diff --git a/lib/libpthread/man/pthread_exit.3 b/lib/libpthread/man/pthread_exit.3 index db1b4fbf03f..6c1153e9e94 100644 --- a/lib/libpthread/man/pthread_exit.3 +++ b/lib/libpthread/man/pthread_exit.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: pthread_exit.3,v 1.9 2002/02/21 20:12:19 fgsch Exp $ +.\" $OpenBSD: pthread_exit.3,v 1.10 2002/05/01 08:03:30 mpech Exp $ .\" .\" Copyright (c) 1996 John Birrell <jb@cimlogic.com.au>. .\" All rights reserved. @@ -47,12 +47,14 @@ The .Fn pthread_exit function terminates the calling thread and makes the value .Fa value_ptr -available to any successful join with the terminating thread. Any +available to any successful join with the terminating thread. +Any cancellation cleanup handlers that have been pushed and are not yet popped are popped in the reverse order that they were pushed and then executed. After all cancellation handlers have been executed, if the thread has any thread-specific data, appropriate destructor functions are called in an -unspecified order. Thread termination does not release any application +unspecified order. +Thread termination does not release any application visible process resources, including, but not limited to, mutexes and file descriptors, nor does it perform any process level cleanup actions, including, but not limited to, calling @@ -73,14 +75,16 @@ that was invoked as the result of an implicit or explicit call to .Fn pthread_exit . .Pp After a thread has terminated, the result of access to local (auto) -variables of the thread is undefined. Thus, references to local variables +variables of the thread is undefined. +Thus, references to local variables of the exiting thread should not be used for the .Fn pthread_exit .Fa value_ptr parameter value. .Pp The process will exit with an exit status of 0 after the last thread has -been terminated. The behavior is as if the implementation called +been terminated. +The behavior is as if the implementation called .Fn exit with a zero argument at thread termination time. .Sh RETURN VALUES diff --git a/lib/libpthread/man/pthread_join.3 b/lib/libpthread/man/pthread_join.3 index 4399970816a..5af3f3e28b9 100644 --- a/lib/libpthread/man/pthread_join.3 +++ b/lib/libpthread/man/pthread_join.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: pthread_join.3,v 1.7 2002/02/21 20:12:19 fgsch Exp $ +.\" $OpenBSD: pthread_join.3,v 1.8 2002/05/01 08:03:30 mpech Exp $ .\" .\" Copyright (c) 1996-1998 John Birrell <jb@cimlogic.com.au>. .\" All rights reserved. @@ -61,10 +61,11 @@ by the terminating thread is stored in the location referenced by .Fa value_ptr . When a .Fn pthread_join -returns successfully, the target thread has been terminated. The results -of multiple simultaneous calls to +returns successfully, the target thread has been terminated. +The results of multiple simultaneous calls to .Fn pthread_join -specifying the same target thread are undefined. If the thread calling +specifying the same target thread are undefined. +If the thread calling .Fn pthread_join is cancelled, then the target thread is not detached. .Pp @@ -73,8 +74,8 @@ A thread that has exited but remains unjoined counts against .Sh RETURN VALUES If successful, the .Fn pthread_join -function will return zero. Otherwise an error number will be returned to -indicate the error. +function will return zero. +Otherwise an error number will be returned to indicate the error. .Sh ERRORS .Fn pthread_join will fail if: diff --git a/lib/libpthread/man/pthread_key_create.3 b/lib/libpthread/man/pthread_key_create.3 index 08ba9ea7e3e..0f5aa51c5dc 100644 --- a/lib/libpthread/man/pthread_key_create.3 +++ b/lib/libpthread/man/pthread_key_create.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: pthread_key_create.3,v 1.6 2002/02/21 20:12:19 fgsch Exp $ +.\" $OpenBSD: pthread_key_create.3,v 1.7 2002/05/01 08:03:30 mpech Exp $ .\" .\" Copyright (c) 1996 John Birrell <jb@cimlogic.com.au>. .\" All rights reserved. @@ -46,9 +46,11 @@ The .Fn pthread_key_create function creates a thread-specific data key visible to all threads in the -process. Key values provided by +process. +Key values provided by .Fn pthread_key_create -are opaque objects used to locate thread-specific data. Although the same +are opaque objects used to locate thread-specific data. +Although the same key value may be used by different threads, the values bound to the key by .Fn pthread_setspecific @@ -56,19 +58,21 @@ are maintained on a per-thread basis and persist for the life of the calling thread. .Pp Upon key creation, the value NULL is associated with the new key in all -active threads. Upon thread creation, the value NULL is associated with all +active threads. +Upon thread creation, the value NULL is associated with all defined keys in the new thread. .Pp -An optional destructor function may be associated with each key value. At -thread exit, if a key value has a non-NULL destructor pointer, and the +An optional destructor function may be associated with each key value. +At thread exit, if a key value has a non-NULL destructor pointer, and the thread has a non-NULL value associated with the key, the function pointed -to is called with the current associated value as its sole argument. The -order of destructor calls is unspecified if more than one destructor exists +to is called with the current associated value as its sole argument. +The order of destructor calls is unspecified if more than one destructor exists for a thread when it exits. .Pp If, after all the destructors have been called for all non-NULL values with associated destructors, there are still some non-NULL values with -associated destructors, then the process is repeated. If, after at least +associated destructors, then the process is repeated. +If, after at least [PTHREAD_DESTRUCTOR_ITERATIONS] iterations of destructor calls for outstanding non-NULL values, there are still some non-NULL values with associated destructors, the implementation stops calling destructors. @@ -77,8 +81,8 @@ If successful, the .Fn pthread_key_create function will store the newly created key value at the location specified by .Fa key -and returns zero. Otherwise an error number will be returned to indicate -the error. +and returns zero. +Otherwise an error number will be returned to indicate the error. .Sh ERRORS .Fn pthread_key_create will fail if: diff --git a/lib/libpthread/man/pthread_key_delete.3 b/lib/libpthread/man/pthread_key_delete.3 index 02c1ee952a1..121c2d87253 100644 --- a/lib/libpthread/man/pthread_key_delete.3 +++ b/lib/libpthread/man/pthread_key_delete.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: pthread_key_delete.3,v 1.7 2002/04/30 16:31:42 mpech Exp $ +.\" $OpenBSD: pthread_key_delete.3,v 1.8 2002/05/01 08:03:30 mpech Exp $ .\" .\" Copyright (c) 1996 John Birrell <jb@cimlogic.com.au>. .\" All rights reserved. @@ -51,12 +51,14 @@ The thread-specific data values associated with .Fa key need not be NULL at the time that .Fn pthread_key_delete -is called. It is the responsibility of the application to free any +is called. +It is the responsibility of the application to free any application storage or perform any cleanup actions for data structures related to the deleted key or associated thread-specific data in any threads; this cleanup can be done either before or after .Fn pthread_key_delete -is called. Any attempt to use +is called. +Any attempt to use .Fa key following the call to .Fn pthread_key_delete @@ -64,8 +66,8 @@ results in undefined behavior. .Pp The .Fn pthread_key_delete -function is callable from within destructor functions. Destructor functions -are not invoked by +function is callable from within destructor functions. +Destructor functions are not invoked by .Fn pthread_key_delete . Any destructor function that may have been associated with .Fa key @@ -73,8 +75,8 @@ will no longer be called upon thread exit. .Sh RETURN VALUES If successful, the .Fn pthread_key_delete -function will return zero. Otherwise an error number will be returned to -indicate the error. +function will return zero. +Otherwise an error number will be returned to indicate the error. .Sh ERRORS .Fn pthread_key_delete will fail if: diff --git a/lib/libpthread/man/pthread_main_np.3 b/lib/libpthread/man/pthread_main_np.3 index 8120bea381f..76e73a3676e 100644 --- a/lib/libpthread/man/pthread_main_np.3 +++ b/lib/libpthread/man/pthread_main_np.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: pthread_main_np.3,v 1.2 2002/02/21 20:44:45 fgsch Exp $ +.\" $OpenBSD: pthread_main_np.3,v 1.3 2002/05/01 08:03:30 mpech Exp $ .\" .\" Copyright (c) 2001 Peter Valchev <pvalchev@openbsd.org>. .\" All rights reserved. @@ -32,6 +32,7 @@ if the calling thread is the main thread if the calling thread is not the main thread .It -1 if the thread initialization has not completed +.El .Sh SEE ALSO .Xr pthread_self 3 , .Xr pthreads 3 diff --git a/lib/libpthread/man/pthread_once.3 b/lib/libpthread/man/pthread_once.3 index 4e1ae2a02de..83e40014787 100644 --- a/lib/libpthread/man/pthread_once.3 +++ b/lib/libpthread/man/pthread_once.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: pthread_once.3,v 1.9 2002/02/21 20:12:19 fgsch Exp $ +.\" $OpenBSD: pthread_once.3,v 1.10 2002/05/01 08:03:30 mpech Exp $ .\" .\" Copyright (c) 1996 John Birrell <jb@cimlogic.com.au>. .\" All rights reserved. @@ -55,7 +55,8 @@ by any thread in a process, with a given .Fa once_control , will call the .Fn init_routine -with no arguments. Subsequent calls to +with no arguments. +Subsequent calls to .Fn pthread_once with the same .Fa once_control @@ -65,14 +66,16 @@ On return from .Fn pthread_once , it is guaranteed that .Fn init_routine -has completed. The +has completed. +The .Fa once_control parameter is used to determine whether the associated initialization routine has been called. .Pp The function .Fn pthread_once -is not a cancellation point. However, if +is not a cancellation point. +However, if .Fn init_routine is a cancellation point and is cancelled, the effect on .Fa once_control is as if @@ -93,8 +96,8 @@ has automatic storage duration or is not initialized by .Sh RETURN VALUES If successful, the .Fn pthread_once -function will return zero. Otherwise an error number will be returned to -indicate the error. +function will return zero. +Otherwise an error number will be returned to indicate the error. .Sh ERRORS None. .Sh STANDARDS diff --git a/lib/libpthread/man/pthread_rwlockattr_destroy.3 b/lib/libpthread/man/pthread_rwlockattr_destroy.3 index 90d99791832..34ef04ad608 100644 --- a/lib/libpthread/man/pthread_rwlockattr_destroy.3 +++ b/lib/libpthread/man/pthread_rwlockattr_destroy.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: pthread_rwlockattr_destroy.3,v 1.6 2000/04/12 21:48:02 aaron Exp $ +.\" $OpenBSD: pthread_rwlockattr_destroy.3,v 1.7 2002/05/01 08:03:30 mpech Exp $ .\" Copyright (c) 1998 Alex Nash .\" All rights reserved. .\" @@ -44,8 +44,8 @@ previously created with .Sh RETURN VALUES If successful, the .Fn pthread_rwlockattr_destroy -function will return zero. Otherwise an error number will be returned -to indicate the error. +function will return zero. +Otherwise an error number will be returned to indicate the error. .Sh SEE ALSO .Xr pthread_rwlockattr_init 3 .Sh STANDARDS diff --git a/lib/libpthread/man/pthread_rwlockattr_getpshared.3 b/lib/libpthread/man/pthread_rwlockattr_getpshared.3 index e4398ad892d..f5cb3b83e5a 100644 --- a/lib/libpthread/man/pthread_rwlockattr_getpshared.3 +++ b/lib/libpthread/man/pthread_rwlockattr_getpshared.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: pthread_rwlockattr_getpshared.3,v 1.6 2000/04/12 21:48:03 aaron Exp $ +.\" $OpenBSD: pthread_rwlockattr_getpshared.3,v 1.7 2002/05/01 08:03:30 mpech Exp $ .\" Copyright (c) 1998 Alex Nash .\" All rights reserved. .\" @@ -39,7 +39,8 @@ The .Fn pthread_rwlockattr_getpshared function is used to get the process shared setting of a read/write -lock attribute object. The setting is returned via +lock attribute object. +The setting is returned via .Fa pshared , and may be one of two values: .Bl -hang -offset flag -width 123456789012345678901234 @@ -48,14 +49,14 @@ Any thread of any process that has access to the memory where the read/write lock resides can manipulate the lock. .It Ar PTHREAD_PROCESS_PRIVATE Only threads created within the same process as the thread that -initialized the read/write lock can manipulate the lock. This is -the default value. +initialized the read/write lock can manipulate the lock. +This is the default value. .El .Sh RETURN VALUES If successful, the .Fn pthread_rwlockattr_getpshared -function will return zero. Otherwise an error number will be returned -to indicate the error. +function will return zero. +Otherwise an error number will be returned to indicate the error. .Sh SEE ALSO .Xr pthread_rwlock_init 3 , .Xr pthread_rwlockattr_init 3 , diff --git a/lib/libpthread/man/pthread_rwlockattr_init.3 b/lib/libpthread/man/pthread_rwlockattr_init.3 index a9e13090d08..14a2fd8dbee 100644 --- a/lib/libpthread/man/pthread_rwlockattr_init.3 +++ b/lib/libpthread/man/pthread_rwlockattr_init.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: pthread_rwlockattr_init.3,v 1.5 2000/04/12 21:48:03 aaron Exp $ +.\" $OpenBSD: pthread_rwlockattr_init.3,v 1.6 2002/05/01 08:03:30 mpech Exp $ .\" Copyright (c) 1998 Alex Nash .\" All rights reserved. .\" @@ -42,8 +42,8 @@ function is used to initialize a read/write lock attributes object. .Sh RETURN VALUES If successful, the .Fn pthread_rwlockattr_init -function will return zero. Otherwise an error number will be returned -to indicate the error. +function will return zero. +Otherwise an error number will be returned to indicate the error. .Sh SEE ALSO .Xr pthread_rwlock_init 3 , .Xr pthread_rwlockattr_destroy 3 , diff --git a/lib/libpthread/man/pthread_rwlockattr_setpshared.3 b/lib/libpthread/man/pthread_rwlockattr_setpshared.3 index d44cdcdfbc6..292940f15e4 100644 --- a/lib/libpthread/man/pthread_rwlockattr_setpshared.3 +++ b/lib/libpthread/man/pthread_rwlockattr_setpshared.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: pthread_rwlockattr_setpshared.3,v 1.5 2000/04/12 21:48:03 aaron Exp $ +.\" $OpenBSD: pthread_rwlockattr_setpshared.3,v 1.6 2002/05/01 08:03:30 mpech Exp $ .\" Copyright (c) 1998 Alex Nash .\" All rights reserved. .\" @@ -50,14 +50,14 @@ Any thread of any process that has access to the memory where the read/write lock resides can manipulate the lock. .It Ar PTHREAD_PROCESS_PRIVATE Only threads created within the same process as the thread that -initialized the read/write lock can manipulate the lock. This is -the default value. +initialized the read/write lock can manipulate the lock. +This is the default value. .El .Sh RETURN VALUES If successful, the .Fn pthread_rwlockattr_setpshared -function will return zero. Otherwise an error number will be returned -to indicate the error. +function will return zero. +Otherwise an error number will be returned to indicate the error. .Sh SEE ALSO .Xr pthread_rwlock_init 3 , .Xr pthread_rwlockattr_init 3 , diff --git a/lib/libpthread/man/pthread_setspecific.3 b/lib/libpthread/man/pthread_setspecific.3 index b64d052f192..977bce59b6f 100644 --- a/lib/libpthread/man/pthread_setspecific.3 +++ b/lib/libpthread/man/pthread_setspecific.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: pthread_setspecific.3,v 1.9 2002/02/21 20:12:19 fgsch Exp $ +.\" $OpenBSD: pthread_setspecific.3,v 1.10 2002/05/01 08:03:30 mpech Exp $ .\" .\" Copyright (c) 1996 John Birrell <jb@cimlogic.com.au>. .\" All rights reserved. @@ -69,8 +69,8 @@ may result in lost storage or infinite loops. .Sh RETURN VALUES If successful, the .Fn pthread_setspecific -function will return zero. Otherwise an error number will be returned to -indicate the error. +function will return zero. +Otherwise an error number will be returned to indicate the error. .Sh ERRORS .Fn pthread_setspecific will fail if: diff --git a/lib/libpthread/man/pthread_testcancel.3 b/lib/libpthread/man/pthread_testcancel.3 index 84fef8dbb57..cd0fcd6933e 100644 --- a/lib/libpthread/man/pthread_testcancel.3 +++ b/lib/libpthread/man/pthread_testcancel.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: pthread_testcancel.3,v 1.8 2002/04/30 16:31:42 mpech Exp $ +.\" $OpenBSD: pthread_testcancel.3,v 1.9 2002/05/01 08:03:30 mpech Exp $ .\" .Dd January 17, 1999 .Dt PTHREAD_TESTCANCEL 3 @@ -64,13 +64,14 @@ respectively. .Pp The .Fn pthread_testcancel -function creates a cancellation point in the calling thread. The +function creates a cancellation point in the calling thread. +The .Fn pthread_testcancel function has no effect if cancelability is disabled. .Ss Cancelability States The cancelability state of a thread determines the action taken upon -receipt of a cancellation request. The thread may control cancellation in -a number of ways. +receipt of a cancellation request. +The thread may control cancellation in a number of ways. .Pp Each thread maintains its own .Dq cancelability state @@ -87,7 +88,8 @@ new or pending cancellation requests may be acted upon at any time. When cancelability is enabled and the cancelability type is .Dv PTHREAD_CANCEL_DEFERRED , cancellation requests are held pending until a cancellation point (see -below) is reached. If cancelability is disabled, the setting of the +below) is reached. +If cancelability is disabled, the setting of the cancelability type has no immediate effect as all cancellation requests are held pending; however, once cancelability is enabled again the new type will be in effect. @@ -122,30 +124,33 @@ If successful, the .Fn pthread_setcancelstate and .Fn pthread_setcanceltype -functions will return zero. Otherwise, an error number shall be returned to -indicate the error. +functions will return zero. +Otherwise, an error number shall be returned to indicate the error. .Pp The .Fn pthread_setcancelstate and .Fn pthread_setcanceltype functions are used to control the points at which a thread may be -asynchronously cancelled. For cancellation control to be usable in modular +asynchronously cancelled. +For cancellation control to be usable in modular fashion, some rules must be followed. .Pp For purposes of this discussion, consider an object to be a generalization of a procedure. It is a set of procedures and global variables written as -a unit and called by clients not known by the object. Objects may depend -on other objects. +a unit and called by clients not known by the object. +Objects may depend on other objects. .Pp First, cancelability should only be disabled on entry to an object, never -explicitly enabled. On exit from an object, the cancelability state should +explicitly enabled. +On exit from an object, the cancelability state should always be restored to its value on entry to the object. .Pp This follows from a modularity argument: if the client of an object (or the client of an object that uses that object) has disabled cancelability, it is because the client doesn't want to have to worry about how to clean up if the -thread is cancelled while executing some sequence of actions. If an object +thread is cancelled while executing some sequence of actions. +If an object is called in such a state and it enables cancelability and a cancellation request is pending for that thread, then the thread will be cancelled, contrary to the wish of the client that disabled. @@ -154,7 +159,8 @@ Second, the cancelability type may be explicitly set to either .Em deferred or .Em asynchronous -upon entry to an object. But as with the cancelability state, on exit from +upon entry to an object. +But as with the cancelability state, on exit from an object that cancelability type should always be restored to its value on entry to the object. .Pp diff --git a/lib/libpthread/man/pthreads.3 b/lib/libpthread/man/pthreads.3 index ebf34d84ac5..daa8cd929a8 100644 --- a/lib/libpthread/man/pthreads.3 +++ b/lib/libpthread/man/pthreads.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: pthreads.3,v 1.17 2002/04/30 16:31:42 mpech Exp $ +.\" $OpenBSD: pthreads.3,v 1.18 2002/05/01 08:03:30 mpech Exp $ .\" David Leonard <d@openbsd.org>, 1998. Public domain. .Dd August 17, 1998 .Dt PTHREADS 3 @@ -23,7 +23,8 @@ option. The .Dv SIGINFO signal can be sent to a threaded process to have the library show the state of -all of its threads. The information is sent to the process' +all of its threads. +The information is sent to the process' controlling tty and describes each thread's ID, state (see @@ -185,8 +186,8 @@ Enables verbose signal output. .It Ev LIBC_R_DEBUG Display thread status every time the garbage collection thread runs, -approximately once every 10 seconds. The status display verbosity is -controled by the +approximately once every 10 seconds. +The status display verbosity is controled by the .Ev PTHREAD_DEBUG environment variable. .El @@ -240,7 +241,8 @@ The library contains a scheduler that uses the process virtual interval timer to pre-empt running threads. This means that using .Xr setitimer 2 -to alter the process virtual timer will have undefined effects. The +to alter the process virtual timer will have undefined effects. +The .Dv SIGVTALRM will never be delivered to threads in a process. .Pp diff --git a/lib/libpthread/man/sem_getvalue.3 b/lib/libpthread/man/sem_getvalue.3 index 244548aa321..25a109102d3 100644 --- a/lib/libpthread/man/sem_getvalue.3 +++ b/lib/libpthread/man/sem_getvalue.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: sem_getvalue.3,v 1.2 2002/02/20 05:29:37 fgsch Exp $ +.\" $OpenBSD: sem_getvalue.3,v 1.3 2002/05/01 08:03:30 mpech Exp $ .\" .\" Copyright (C) 2000 Jason Evans <jasone@FreeBSD.org>. .\" All rights reserved. @@ -68,6 +68,7 @@ conforms to .St -p1003.1-96 . .Pp The value of the semaphore is never negative, even if there are threads blocked -on the semaphore. POSIX is somewhat ambiguous in its wording with regard to +on the semaphore. +POSIX is somewhat ambiguous in its wording with regard to what the value of the semaphore should be if there are blocked waiting threads, but this behavior is conformant, given the wording of the specification. diff --git a/lib/libpthread/man/sem_wait.3 b/lib/libpthread/man/sem_wait.3 index 3ead247bd20..00d5a2fe4f3 100644 --- a/lib/libpthread/man/sem_wait.3 +++ b/lib/libpthread/man/sem_wait.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: sem_wait.3,v 1.3 2002/02/20 05:29:37 fgsch Exp $ +.\" $OpenBSD: sem_wait.3,v 1.4 2002/05/01 08:03:30 mpech Exp $ .\" .\" Copyright (C) 2000 Jason Evans <jasone@FreeBSD.org>. .\" All rights reserved. @@ -54,7 +54,8 @@ The .Fn sem_trywait function decrements (locks) the semaphore pointed to by .Fa sem -only if the value is non-zero. Otherwise, the semaphore is not decremented and +only if the value is non-zero. +Otherwise, the semaphore is not decremented and an error is returned. .Sh RETURN VALUES .Rv -std sem_wait |