73 |
78 |
74 /* |
79 /* |
75 * Array of available resources |
80 * Array of available resources |
76 * each entry is created with ResourceType.createresource |
81 * each entry is created with ResourceType.createresource |
77 */ |
82 */ |
78 void **resources; |
83 ResourceDataPrivate **resources; |
79 |
84 |
80 /* |
85 /* |
81 * Allocated size of the resources array |
86 * Allocated size of the resources array |
82 */ |
87 */ |
83 size_t resalloc; |
88 size_t resalloc; |
84 |
89 |
85 /* |
90 /* |
86 * Number of currently available resources in the array |
91 * Number of currently available resources in the array |
87 */ |
92 */ |
88 size_t numresources; |
93 size_t numresources; |
|
94 |
|
95 |
|
96 /* |
|
97 * Number of created resources (in use + available) |
|
98 */ |
|
99 size_t numcreated; |
89 |
100 |
90 /* |
101 /* |
91 * resource pool min parameter |
102 * resource pool min parameter |
92 */ |
103 */ |
93 int min; |
104 int min; |
100 |
111 |
101 int init_resource_pools(void); |
112 int init_resource_pools(void); |
102 |
113 |
103 int resourcepool_new(ServerConfiguration *cfg, scstr_t type, scstr_t name, ConfigNode *node); |
114 int resourcepool_new(ServerConfiguration *cfg, scstr_t type, scstr_t name, ConfigNode *node); |
104 |
115 |
105 int resourcepool_create_resources(ResourcePool *pool, int num_res); |
116 void resourcepool_destroy_resource(ResourceDataPrivate *res); |
106 |
117 |
107 void resourcepool_destroy(ResourcePool *respool); |
118 void resourcepool_destroy(ResourcePool *respool); |
108 |
119 |
109 #ifdef __cplusplus |
120 #ifdef __cplusplus |
110 } |
121 } |