summaryrefslogtreecommitdiff
path: root/lib/libpthread/man
diff options
context:
space:
mode:
authorJason McIntyre <jmc@cvs.openbsd.org>2004-01-02 09:28:37 +0000
committerJason McIntyre <jmc@cvs.openbsd.org>2004-01-02 09:28:37 +0000
commit6aff649090c621b86a47846ee0f99f8261765040 (patch)
tree8da817e61758684d6687eefd24ae00050e32f859 /lib/libpthread/man
parente6dae4f57fb345f70e27a7818345c5b1907792c6 (diff)
add a section on thread safety, which is a start at documenting which
functions are not thread safe; started by a request from Marc Balmer to document that malloc(3) *was* thread safe, and expanded by marc@ to list functions that are not; also add some spacing to make the page more readable, and adjust the -width of a list; ok marc@
Diffstat (limited to 'lib/libpthread/man')
-rw-r--r--lib/libpthread/man/pthreads.395
1 files changed, 93 insertions, 2 deletions
diff --git a/lib/libpthread/man/pthreads.3 b/lib/libpthread/man/pthreads.3
index 937c02a26c8..282702ff6e9 100644
--- a/lib/libpthread/man/pthreads.3
+++ b/lib/libpthread/man/pthreads.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: pthreads.3,v 1.20 2003/12/23 20:10:45 brad Exp $
+.\" $OpenBSD: pthreads.3,v 1.21 2004/01/02 09:28:36 jmc Exp $
.\" David Leonard <d@openbsd.org>, 1998. Public domain.
.Dd August 17, 1998
.Dt PTHREADS 3
@@ -39,6 +39,7 @@ If the environment variable
is defined additional information is displayed.
.Ss Thread states
Threads can be in one of these states:
+.Pp
.Bl -tag -offset indent -width Dv -compact
.It cond_wait
Executing
@@ -108,6 +109,7 @@ or similar.
.El
.Ss Thread flags
The first three flags are one of:
+.Pp
.Bl -tag -offset indent -width 3en -compact
.It "p"
Private, system thread (e.g., the garbage collector).
@@ -118,7 +120,9 @@ or is at a cancellation point (c).
.It "t"
Thread is being traced.
.El
+.Pp
The next 7 flags refer to thread attributes:
+.Pp
.Bl -tag -offset indent -width 3en -compact
.It "C"
Thread is in the
@@ -143,6 +147,7 @@ Thread will save floating point context.
.Ss Scheduling algorithm
The scheduling algorithm used by the user-level thread library is
roughly as follows:
+.Pp
.Bl -enum -compact
.It
Threads each have a time slice credit which is debited
@@ -178,8 +183,94 @@ signal, you should make use of
.Xr sigaltstack 2
or
.Xr sigprocmask 2 .
+.Ss Thread safety
+The following functions are not thread safe:
+.Bd -filled
+asctime(),
+basename(),
+catgets(),
+crypt(),
+ctime(),
+dbm_clearerr(),
+dbm_close(),
+dbm_delete(),
+dbm_error(),
+dbm_fetch(),
+dbm_firstkey(),
+dbm_nextkey(),
+dbm_open(),
+dbm_store(),
+dirname(),
+dlerror(),
+drand48(),
+ecvt(),
+encrypt(),
+endgrent(),
+endpwent(),
+fcvt(),
+ftw(),
+gcvt(),
+getc_unlocked(),
+getchar_unlocked(),
+getenv(),
+getgrent(),
+getgrgid(),
+getgrnam(),
+gethostbyaddr(),
+gethostbyname(),
+gethostent(),
+getlogin(),
+getnetbyaddr(),
+getnetbyname(),
+getnetent(),
+getopt(),
+getprotobyname(),
+getprotobynumber(),
+getprotoent(),
+getpwent(),
+getpwnam(),
+getpwuid(),
+getservbyname(),
+getservbyport(),
+getservent(),
+gmtime(),
+hcreate(),
+hdestroy(),
+hsearch(),
+inet_ntoa(),
+l64a(),
+lgamma(),
+lgammaf(),
+localeconv(),
+localtime(),
+lrand48(),
+mrand48(),
+nftw(),
+nl_langinfo(),
+putc_unlocked(),
+putchar_unlocked(),
+putenv(),
+rand(),
+readdir(),
+setenv(),
+setgrent(),
+setkey(),
+setpwent(),
+strerror(),
+strtok(),
+ttyname(),
+unsetenv(),
+.Ed
+.Pp
+The
+.Fn ctermid
+and
+.Fn tmpnam
+functions are not thread safe when passed a
+.Dv NULL
+argument.
.Sh ENVIRONMENT
-.Bl -tag -width "PTHREAD_DEBUG"
+.Bl -tag -width "LIBPTHREAD_DEBUG"
.It Ev PTHREAD_DEBUG
Enables verbose
.Dv SIGINFO