Commit 176190e6 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Also retire the waitinglist structure if the number of sessions on

it happened to be a multiplum of rush_exponent.

Fixes:	#842
parent 1ed1f4df
......@@ -485,11 +485,8 @@ hsh_rush(struct objhead *oh)
CHECK_OBJ_NOTNULL(wl, WAITINGLIST_MAGIC);
for (u = 0; u < params->rush_exponent; u++) {
sp = VTAILQ_FIRST(&wl->list);
if (sp == NULL) {
oh->waitinglist = NULL;
FREE_OBJ(wl);
return;
}
if (sp == NULL)
break;
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
AZ(sp->wrk);
VTAILQ_REMOVE(&wl->list, sp, list);
......@@ -503,6 +500,10 @@ hsh_rush(struct objhead *oh)
break;
}
}
if (VTAILQ_EMPTY(&wl->list)) {
oh->waitinglist = NULL;
FREE_OBJ(wl);
}
}
/*---------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment