postgis: Thread safe ConnectionManager
This commit is contained in:
parent
d8dbe11fd0
commit
497055d80d
1 changed files with 6 additions and 0 deletions
|
@ -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())
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue