Skip to content

Commit

Permalink
Revert "adapt fix for race condition in arbiter"
Browse files Browse the repository at this point in the history
This reverts commit 6876e7a.
  • Loading branch information
hobu committed Jun 6, 2024
1 parent 6876e7a commit bb4da9c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions entwine/third/arbiter/arbiter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,13 +353,16 @@ std::shared_ptr<Driver> Arbiter::getDriver(const std::string path) const
{
const auto type(getProtocol(path));

std::lock_guard<std::mutex> lock(m_mutex);
auto it = m_drivers.find(type);
if (it != m_drivers.end()) return it->second;
{
std::lock_guard<std::mutex> lock(m_mutex);
auto it = m_drivers.find(type);
if (it != m_drivers.end()) return it->second;
}

const json config = getConfig(m_config);
if (auto driver = Driver::create(*m_pool, type, config.dump()))
{
std::lock_guard<std::mutex> lock(m_mutex);
m_drivers[type] = driver;
return driver;
}
Expand Down

0 comments on commit bb4da9c

Please sign in to comment.