diff options
author | Alessandro Ghedini <alessandro@ghedini.me> | 2016-03-02 17:36:17 +0000 |
---|---|---|
committer | Alessandro Ghedini <alessandro@cloudflare.com> | 2016-03-08 14:11:09 +0000 |
commit | 8509dcc9f319190c565ab6baad7c88d37a951d1c (patch) | |
tree | d4b44b7ed13c84a55d73ff0254e370d753587c53 /doc | |
parent | f75200115d1a778c39c8a8850823928d8be1f8ac (diff) |
Convert ERR_STATE to new multi-threading API
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/crypto/ERR_remove_state.pod | 14 | ||||
-rw-r--r-- | doc/crypto/err.pod | 11 |
2 files changed, 11 insertions, 14 deletions
diff --git a/doc/crypto/ERR_remove_state.pod b/doc/crypto/ERR_remove_state.pod index 55ded84c48..b011182c47 100644 --- a/doc/crypto/ERR_remove_state.pod +++ b/doc/crypto/ERR_remove_state.pod @@ -8,7 +8,7 @@ ERR_remove_thread_state, ERR_remove_state - free a thread's error queue #include <openssl/err.h> - void ERR_remove_thread_state(const CRYPTO_THREADID *tid); + void ERR_remove_thread_state(void); Deprecated: @@ -18,17 +18,16 @@ Deprecated: =head1 DESCRIPTION -ERR_remove_thread_state() frees the error queue associated with thread B<tid>. -If B<tid> == B<NULL>, the current thread will have its error queue removed. +ERR_remove_thread_state() frees the error queue associated with the current +thread. Since error queue data structures are allocated automatically for new threads, they must be freed when threads are terminated in order to avoid memory leaks. ERR_remove_state is deprecated and has been replaced by -ERR_remove_thread_state. Since threads in OpenSSL are no longer identified -by unsigned long values any argument to this function is ignored. Calling -ERR_remove_state is equivalent to B<ERR_remove_thread_state(NULL)>. +ERR_remove_thread_state. Any argument to this function is ignored and +calling ERR_remove_state is equivalent to B<ERR_remove_thread_state()>. =head1 RETURN VALUE @@ -41,7 +40,6 @@ L<err(3)> =head1 HISTORY ERR_remove_state() -was deprecated in OpenSSL 1.0.0 when ERR_remove_thread_state() was introduced -and thread IDs were introduced to identify threads instead of 'unsigned long'. +was deprecated in OpenSSL 1.0.0 when ERR_remove_thread_state() was introduced. =cut diff --git a/doc/crypto/err.pod b/doc/crypto/err.pod index 5fafbc5490..6847f2153c 100644 --- a/doc/crypto/err.pod +++ b/doc/crypto/err.pod @@ -22,7 +22,7 @@ err - error codes int ERR_GET_REASON(unsigned long e); void ERR_clear_error(void); - void ERR_remove_thread_state(const CRYPTO_THREADID *tid); + void ERR_remove_thread_state(void); char *ERR_error_string(unsigned long e, char *buf); const char *ERR_lib_error_string(unsigned long e); @@ -164,15 +164,14 @@ TBA more details =head1 INTERNALS -The error queues are stored in a hash table with one B<ERR_STATE> -entry for each pid. ERR_get_state() returns the current thread's +The error queues are stored in a thread-local storage with one B<ERR_STATE> +entry for each thread. ERR_get_state() returns the current thread's B<ERR_STATE>. An B<ERR_STATE> can hold up to B<ERR_NUM_ERRORS> error codes. When more error codes are added, the old ones are overwritten, on the assumption that the most recent errors are most important. -Error strings are also stored in hash table. The hash tables can -be obtained by calling ERR_get_err_state_table(void) and -ERR_get_string_table(void) respectively. +Error strings are also stored in a hash table that can be obtained +by calling ERR_get_string_table(void). =head1 SEE ALSO |