AceMeistr commented on issue #13225:
URL: 
https://github.com/apache/trafficserver/issues/13225#issuecomment-4605557677

   I have applied the fix with: 
   
   ```cpp
   SSLCertContext &
   SSLCertContext::operator=(SSLCertContext const &other)
   {
     if (&other != this) {
       std::scoped_lock lock(this->ctx_mutex, other.ctx_mutex);
       this->opt        = other.opt;
       this->userconfig = other.userconfig;
       this->keyblock   = other.keyblock;
       this->ctx_type   = other.ctx_type;
       this->ctx        = other.ctx;
     }
     return *this;
   }
   ```
   Replaced the manual lock definition and sequence with std::scoped_lock to 
lock both the target and source object mutexes at once simultaneously 
   Resolves data races if another thread tried to read or modify the target 
object concurrently.
   
   also pushed lock guard to beginning to avoid source mutation during read to 
avoid data race by threads
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to