4#include <rudiments/stdio.h>
5#include <rudiments/private/nodeinlines.h>
7template <
class valuetype>
15template <
class valuetype>
21template <
class valuetype>
30template <
class valuetype>
36template <
class valuetype>
42template <
class valuetype>
48template <
class valuetype>
51 this->growby=(!growby)?1:growby;
54template <
class valuetype>
60template <
class valuetype>
65 if (mtx && !mtx->
lock()) {
69 for (uint64_t
i=0;
i<minval;
i++) {
81 initiallist.append(v);
94template <
class valuetype>
99 if (mtx && !mtx->
lock()) {
112template <
class valuetype>
117 if (mtx && !mtx->
lock()) {
133template <
class valuetype>
137 initiallist.setManageValues(
true);
139 initiallist.setManageValues(
false);
141 ondemandlist.setManageValues(
true);
142 ondemandlist.clear();
143 ondemandlist.setManageValues(
false);
148template <
class valuetype>
153 if (mtx && !mtx->
lock()) {
159 if (initiallist.getCount()) {
166 initialtree.insert(v);
167 initiallist.remove(
node);
181 if (!ondemandlist.getCount()) {
182 for (uint64_t
i=0;
i<growby && total<maxval;
i++) {
184 ondemandlist.append(v);
191 if (ondemandlist.getCount()) {
198 ondemandtree.insert(v);
199 ondemandlist.remove(
node);
219template <
class valuetype>
237 initialtree.remove(
node);
250 ondemandtree.remove(
node);
262template <
class valuetype>
268template <
class valuetype>
274template <
class valuetype>
277 return initiallist.getCount();
281template <
class valuetype>
284 return ondemandlist.getCount();
avltreenode(valuetype value)
Definition avltreeinlines.h:555
valuetype getValue()
Definition avltreeinlines.h:578
Definition resourcepool.h:14
bool returnResource(valuetype *resource)
Definition resourcepoolinlines.h:221
void setGrowBy(uint64_t growby)
Definition resourcepoolinlines.h:50
virtual ~resourcepool()
Definition resourcepoolinlines.h:17
bool clear()
Definition resourcepoolinlines.h:96
void setMutex(threadmutex *mtx)
Definition resourcepoolinlines.h:270
uint64_t getMax()
Definition resourcepoolinlines.h:44
uint64_t getAvailableOnDemandResourceCount()
Definition resourcepoolinlines.h:283
uint64_t getGrowBy()
Definition resourcepoolinlines.h:56
bool reset()
Definition resourcepoolinlines.h:114
resourcepool()
Definition resourcepoolinlines.h:9
bool create()
Definition resourcepoolinlines.h:62
uint64_t getMin()
Definition resourcepoolinlines.h:32
valuetype * borrowResource()
Definition resourcepoolinlines.h:150
void setMax(uint64_t max)
Definition resourcepoolinlines.h:38
void setMin(uint64_t min)
Definition resourcepoolinlines.h:23
uint64_t getAvailableInitialResourceCount()
Definition resourcepoolinlines.h:276
Definition threadmutex.h:11