}
static struct host *lih_host;
-static int lih_host_held = 0;
+static int lih_host_held;
static int
lih_r(register struct host *host, register int held,
register struct host *hostp)
{
- lih_host_held = 0;
if (host->cblist
&& ((hostp && host != hostp) || (!held && !h_OtherHolds_r(host)))
&& (!lih_host || host->ActiveCall < lih_host->ActiveCall)) {
+ if (lih_host != NULL && lih_host_held) {
+ h_Release_r(lih_host);
+ }
lih_host = host;
- }
- if (!held) {
+ lih_host_held = !held;
held = 1;
- lih_host_held = 1;
}
return held;
}
h_Enumerate_r(lih_r, hp2, (char *)hp1);
hp = lih_host;
if (hp) {
+ /* set in lih_r! private copy before giving up H_LOCK */
+ int lih_host_held2=lih_host_held;
cbstuff.GSS4++;
if (!ClearHostCallbacks_r(hp, 0 /* not locked or held */ )) {
- if (lih_host_held)
+ if (lih_host_held2)
h_Release_r(hp);
return 0;
}
- if (lih_host_held)
+ if (lih_host_held2)
h_Release_r(hp);
hp2 = hp->next;
} else {