diff options
author | simon <simon@FreeBSD.org> | 2006-07-29 19:41:41 +0000 |
---|---|---|
committer | simon <simon@FreeBSD.org> | 2006-07-29 19:41:41 +0000 |
commit | 018ef6efe1e20b420eaa3afdaa37b0abeba93a1a (patch) | |
tree | e9b6155f49a3b6073b95b808e1e0a1ec5489a21f /secure/lib/libcrypto/man/threads.3 | |
parent | 152e76d1d1dcc649357b52f30943345b06aa162c (diff) | |
download | FreeBSD-src-018ef6efe1e20b420eaa3afdaa37b0abeba93a1a.zip FreeBSD-src-018ef6efe1e20b420eaa3afdaa37b0abeba93a1a.tar.gz |
Upgrade to OpenSSL 0.9.8b.
Diffstat (limited to 'secure/lib/libcrypto/man/threads.3')
-rw-r--r-- | secure/lib/libcrypto/man/threads.3 | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/secure/lib/libcrypto/man/threads.3 b/secure/lib/libcrypto/man/threads.3 index a2ee2f8..e5cedad 100644 --- a/secure/lib/libcrypto/man/threads.3 +++ b/secure/lib/libcrypto/man/threads.3 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 +.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32 .\" .\" Standard preamble: .\" ======================================================================== @@ -129,7 +129,7 @@ .\" ======================================================================== .\" .IX Title "threads 3" -.TH threads 3 "2005-02-24" "0.9.7d" "OpenSSL" +.TH threads 3 "2006-07-29" "0.9.8b" "OpenSSL" .SH "NAME" CRYPTO_set_locking_callback, CRYPTO_set_id_callback, CRYPTO_num_locks, CRYPTO_set_dynlock_create_callback, CRYPTO_set_dynlock_lock_callback, @@ -211,9 +211,10 @@ different mutex locks. It sets the \fBn\fR\-th lock if \fBmode\fR & \&\fBfile\fR and \fBline\fR are the file number of the function setting the lock. They can be useful for debugging. .PP -id_function(void) is a function that returns a thread \s-1ID\s0. It is not +id_function(void) is a function that returns a thread \s-1ID\s0, for example +\&\fIpthread_self()\fR if it returns an integer (see \s-1NOTES\s0 below). It isn't needed on Windows nor on platforms where \fIgetpid()\fR returns a different -\&\s-1ID\s0 for each thread (most notably Linux). +\&\s-1ID\s0 for each thread (see \s-1NOTES\s0 below). .PP Additionally, OpenSSL supports dynamic locks, and sometimes, some parts of OpenSSL need it for better performance. To enable this, the following @@ -265,14 +266,14 @@ should not be used together): \&\fICRYPTO_get_new_dynlockid()\fR returns the index to the newly created lock. .PP The other functions return no values. -.SH "NOTE" -.IX Header "NOTE" +.SH "NOTES" +.IX Header "NOTES" You can find out if OpenSSL was configured with thread support: .PP .Vb 7 \& #define OPENSSL_THREAD_DEFINES \& #include <openssl/opensslconf.h> -\& #if defined(THREADS) +\& #if defined(OPENSSL_THREADS) \& // thread support enabled \& #else \& // no thread support @@ -281,6 +282,22 @@ You can find out if OpenSSL was configured with thread support: .PP Also, dynamic locks are currently not used internally by OpenSSL, but may do so in the future. +.PP +Defining id_function(void) has it's own issues. Generally speaking, +\&\fIpthread_self()\fR should be used, even on platforms where \fIgetpid()\fR gives +different answers in each thread, since that may depend on the machine +the program is run on, not the machine where the program is being +compiled. For instance, Red Hat 8 Linux and earlier used +LinuxThreads, whose \fIgetpid()\fR returns a different value for each +thread. Red Hat 9 Linux and later use \s-1NPTL\s0, which is +Posix\-conformant, and has a \fIgetpid()\fR that returns the same value for +all threads in a process. A program compiled on Red Hat 8 and run on +Red Hat 9 will therefore see \fIgetpid()\fR returning the same value for +all threads. +.PP +There is still the issue of platforms where \fIpthread_self()\fR returns +something other than an integer. This is a bit unusual, and this +manual has no cookbook solution for that case. .SH "EXAMPLES" .IX Header "EXAMPLES" \&\fBcrypto/threads/mttest.c\fR shows examples of the callback functions on |