Lines 75-80
static void svc_new_thread(SVCGROUP *grp
Link Here
|
75 |
static void xprt_unregister_locked(SVCXPRT *xprt); |
75 |
static void xprt_unregister_locked(SVCXPRT *xprt); |
76 |
static void svc_change_space_used(SVCPOOL *pool, long delta); |
76 |
static void svc_change_space_used(SVCPOOL *pool, long delta); |
77 |
static bool_t svc_request_space_available(SVCPOOL *pool); |
77 |
static bool_t svc_request_space_available(SVCPOOL *pool); |
|
|
78 |
static void svcpool_cleanup(SVCPOOL *pool); |
78 |
|
79 |
|
79 |
/* *************** SVCXPRT related stuff **************** */ |
80 |
/* *************** SVCXPRT related stuff **************** */ |
80 |
|
81 |
|
Lines 174-181
svcpool_create(const char *name, struct
Link Here
|
174 |
return pool; |
175 |
return pool; |
175 |
} |
176 |
} |
176 |
|
177 |
|
177 |
void |
178 |
/* |
178 |
svcpool_destroy(SVCPOOL *pool) |
179 |
* Code common to svcpool_destroy() and svcpool_close(), which cleans up |
|
|
180 |
* the pool data structures. |
181 |
*/ |
182 |
static void |
183 |
svcpool_cleanup(SVCPOOL *pool) |
179 |
{ |
184 |
{ |
180 |
SVCGROUP *grp; |
185 |
SVCGROUP *grp; |
181 |
SVCXPRT *xprt, *nxprt; |
186 |
SVCXPRT *xprt, *nxprt; |
Lines 211-216
svcpool_destroy(SVCPOOL *pool)
Link Here
|
211 |
mtx_lock(&pool->sp_lock); |
216 |
mtx_lock(&pool->sp_lock); |
212 |
} |
217 |
} |
213 |
mtx_unlock(&pool->sp_lock); |
218 |
mtx_unlock(&pool->sp_lock); |
|
|
219 |
} |
220 |
|
221 |
void |
222 |
svcpool_destroy(SVCPOOL *pool) |
223 |
{ |
224 |
SVCGROUP *grp; |
225 |
int g; |
226 |
|
227 |
svcpool_cleanup(pool); |
214 |
|
228 |
|
215 |
for (g = 0; g < SVC_MAXGROUPS; g++) { |
229 |
for (g = 0; g < SVC_MAXGROUPS; g++) { |
216 |
grp = &pool->sp_groups[g]; |
230 |
grp = &pool->sp_groups[g]; |
Lines 226-231
svcpool_destroy(SVCPOOL *pool)
Link Here
|
226 |
} |
240 |
} |
227 |
|
241 |
|
228 |
/* |
242 |
/* |
|
|
243 |
* Similar to svcpool_destroy(), except that it does not destroy the actual |
244 |
* data structures. As such, "pool" may be used again. |
245 |
*/ |
246 |
void |
247 |
svcpool_close(SVCPOOL *pool) |
248 |
{ |
249 |
SVCGROUP *grp; |
250 |
int g; |
251 |
|
252 |
svcpool_cleanup(pool); |
253 |
|
254 |
/* Now, initialize the pool's state for a fresh svc_run() call. */ |
255 |
mtx_lock(&pool->sp_lock); |
256 |
pool->sp_state = SVCPOOL_INIT; |
257 |
mtx_unlock(&pool->sp_lock); |
258 |
for (g = 0; g < SVC_MAXGROUPS; g++) { |
259 |
grp = &pool->sp_groups[g]; |
260 |
mtx_lock(&grp->sg_lock); |
261 |
grp->sg_state = SVCPOOL_ACTIVE; |
262 |
mtx_unlock(&grp->sg_lock); |
263 |
} |
264 |
} |
265 |
|
266 |
/* |
229 |
* Sysctl handler to get the present thread count on a pool |
267 |
* Sysctl handler to get the present thread count on a pool |
230 |
*/ |
268 |
*/ |
231 |
static int |
269 |
static int |