diff options
author | Matt Caswell <matt@openssl.org> | 2020-06-26 11:00:25 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2020-06-28 10:55:52 +0200 |
commit | 6c689e58f70726cfa5533bc10f9669abce199fb8 (patch) | |
tree | 102c08ba61faae7e9838b0f2481dc188227b2b20 /doc/man3 | |
parent | cfbd76c1a9737617d4cf90d3a1af704241c97d98 (diff) |
Make the ASYNC code default libctx aware
Since the default libctx is now stored in a thread local variable
swapping in and out of fibres in the ASYNC code could mean that the
"current" default libctx can get confused. Therefore we ensure that
everytime we call async_fibre_swapcontext() we always restore the default
libctx to whatever it was the last time the fibre ran. Similarly when
async_fibre_swapcontext() returns we need to restore the current thread's
default libctx.
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/12228)
Diffstat (limited to 'doc/man3')
-rw-r--r-- | doc/man3/OPENSSL_CTX.pod | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/doc/man3/OPENSSL_CTX.pod b/doc/man3/OPENSSL_CTX.pod index 0a98451f3d..01737de2ef 100644 --- a/doc/man3/OPENSSL_CTX.pod +++ b/doc/man3/OPENSSL_CTX.pod @@ -43,6 +43,14 @@ I<ctx> in the current thread. The previous default library context is returned. Care should be taken by the caller to restore the previous default library context with a subsequent call of this function. +Care should be taken when changing the default library context and starting +async jobs (see L<ASYNC_start_job(3)>), as the default library context when +the job is started will be used throughout the lifetime of an async job, no +matter how the calling thread makes further default library context changes +in the mean time. This means that the calling thread must not free the +library context that was the default at the start of the async job before +that job has finished. + =head1 RETURN VALUES OPENSSL_CTX_new() and OPENSSL_CTX_set0_default() return a library context |