postgis: Thread safe ConnectionManager

This commit is contained in:
Jiri Drbalek 2018-02-28 10:35:19 +01:00
parent d8dbe11fd0
commit 497055d80d

View file

@ -115,6 +115,9 @@ public:
bool registerPool(ConnectionCreator<Connection> const& creator,unsigned initialSize,unsigned maxSize)
{
#ifdef MAPNIK_THREADSAFE
std::lock_guard<std::mutex> lock(mutex_);
#endif
ContType::const_iterator itr = pools_.find(creator.id());
if (itr != pools_.end())
@ -134,6 +137,9 @@ public:
std::shared_ptr<PoolType> getPool(std::string const& key)
{
#ifdef MAPNIK_THREADSAFE
std::lock_guard<std::mutex> lock(mutex_);
#endif
ContType::const_iterator itr=pools_.find(key);
if (itr!=pools_.end())
{