+ add getter/setter for maxSize

This commit is contained in:
artemp 2012-11-28 17:04:12 +00:00
parent 9afaf091b1
commit 35fba36bcc

View file

@ -72,7 +72,7 @@ class Pool : private boost::noncopyable
Creator<T> creator_;
const unsigned initialSize_;
const unsigned maxSize_;
unsigned maxSize_;
ContType usedPool_;
ContType unusedPool_;
#ifdef MAPNIK_THREADSAFE
@ -160,6 +160,22 @@ public:
std::pair<unsigned,unsigned> size(unusedPool_.size(),usedPool_.size());
return size;
}
unsigned max_size() const
{
#ifdef MAPNIK_THREADSAFE
mutex::scoped_lock lock(mutex_);
#endif
return maxSize_;
}
void set_max_size(unsigned size)
{
#ifdef MAPNIK_THREADSAFE
mutex::scoped_lock lock(mutex_);
#endif
maxSize_ = size;
}
};
}