Remove st_idle variable, duplicating st_xprt.

MFC after:	2 weeks
This commit is contained in:
Alexander Motin 2014-06-08 10:18:22 +00:00
parent b776fb2d67
commit b5d7fb7398
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=267223
2 changed files with 1 additions and 6 deletions

View File

@ -340,7 +340,6 @@ xprt_assignthread(SVCXPRT *xprt)
st = LIST_FIRST(&pool->sp_idlethreads);
if (st) {
LIST_REMOVE(st, st_ilink);
st->st_idle = FALSE;
SVC_ACQUIRE(xprt);
xprt->xp_thread = st;
st->st_xprt = xprt;
@ -1138,7 +1137,6 @@ svc_run_internal(SVCPOOL *pool, bool_t ismaster)
}
LIST_INSERT_HEAD(&pool->sp_idlethreads, st, st_ilink);
st->st_idle = TRUE;
if (ismaster || (!ismaster &&
pool->sp_threadcount > pool->sp_minthreads))
error = cv_timedwait_sig(&st->st_cond,
@ -1146,10 +1144,8 @@ svc_run_internal(SVCPOOL *pool, bool_t ismaster)
else
error = cv_wait_sig(&st->st_cond,
&pool->sp_lock);
if (st->st_idle) {
if (st->st_xprt == NULL)
LIST_REMOVE(st, st_ilink);
st->st_idle = FALSE;
}
/*
* Reduce worker thread count when idle.

View File

@ -295,7 +295,6 @@ typedef struct __rpc_svcthread {
struct __rpc_svcpool *st_pool;
SVCXPRT *st_xprt; /* transport we are processing */
struct svc_reqlist st_reqs; /* RPC requests to execute */
int st_idle; /* thread is on idle list */
struct cv st_cond; /* sleeping for work */
LIST_ENTRY(__rpc_svcthread) st_link; /* all threads list */
LIST_ENTRY(__rpc_svcthread) st_ilink; /* idle threads list */