+ add getter/setter for maxSize
This commit is contained in:
parent
9afaf091b1
commit
35fba36bcc
1 changed files with 17 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue