summaryrefslogtreecommitdiffstats
path: root/crypto/initthread.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2019-05-28 16:21:19 +0100
committerMatt Caswell <matt@openssl.org>2019-06-17 16:19:44 +0100
commit52b18ce10498dc2d8ced7db31ead116f4eeca134 (patch)
tree03b9010afd6a4089e6beeb41fe04dbcf31b39c6e /crypto/initthread.c
parentda747958c5db57dbe22c015d058be9db8a90f8f9 (diff)
Add the function OPENSSL_thread_stop_ex()
This adds the ability to clean up a thread on a per OPENSSL_CTX basis. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9040)
Diffstat (limited to 'crypto/initthread.c')
-rw-r--r--crypto/initthread.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/crypto/initthread.c b/crypto/initthread.c
index 124fdccd6e..02a51ee5d2 100644
--- a/crypto/initthread.c
+++ b/crypto/initthread.c
@@ -97,6 +97,17 @@ void cleanup_thread(void)
destructor_key.sane = -1;
}
+void OPENSSL_thread_stop_ex(OPENSSL_CTX *ctx)
+{
+ ctx = openssl_ctx_get_concrete(ctx);
+ /*
+ * TODO(3.0). It would be nice if we could figure out a way to do this on
+ * all threads that have used the OPENSSL_CTX when the OPENSSL_CTX is freed.
+ * This is currently not possible due to the use of thread local variables.
+ */
+ ossl_ctx_thread_stop(ctx);
+}
+
void OPENSSL_thread_stop(void)
{
if (destructor_key.sane != -1) {