remove double checking mutex (#528)

This commit is contained in:
Victor Vazquez 2020-08-25 22:52:02 +00:00 committed by GitHub
parent 80f2c2f407
commit 760c645af0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -786,9 +786,6 @@ std::unique_ptr<CurlSession::CurlConnection> CurlSession::GetCurlConnection(Requ
{
std::string const& host = request.GetHost();
// Double-check locking. Check if there is any available connection before locking mutex
auto& hostPoolFirstCheck = s_connectionPoolIndex[host];
if (hostPoolFirstCheck.size() > 0)
{
// Critical section. Needs to own s_connectionPoolMutex before executing
// Lock mutex to access connection pool. mutex is unlock as soon as lock is out of scope