File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -234,24 +234,24 @@ ssl_create_ticket_keyblock(const char *ticket_key_path)
234234
235235SSLCertContext::SSLCertContext (SSLCertContext const &other)
236236{
237+ std::shared_lock lock (other.ctx_mutex );
237238 opt = other.opt ;
238239 userconfig = other.userconfig ;
239240 keyblock = other.keyblock ;
240241 ctx_type = other.ctx_type ;
241- std::shared_lock lock (other.ctx_mutex );
242- ctx = other.ctx ;
242+ ctx = other.ctx ;
243243}
244244
245245SSLCertContext &
246246SSLCertContext::operator =(SSLCertContext const &other)
247247{
248248 if (&other != this ) {
249+ std::scoped_lock lock (this ->ctx_mutex , other.ctx_mutex );
249250 this ->opt = other.opt ;
250251 this ->userconfig = other.userconfig ;
251252 this ->keyblock = other.keyblock ;
252253 this ->ctx_type = other.ctx_type ;
253- std::shared_lock lock (other.ctx_mutex );
254- this ->ctx = other.ctx ;
254+ this ->ctx = other.ctx ;
255255 }
256256 return *this ;
257257}
You can’t perform that action at this time.
0 commit comments