When events on a reference is cancelled, check our doorstep first,

it might be an orphan.
This commit is contained in:
Poul-Henning Kamp 2003-05-01 19:24:00 +00:00
parent 6140afa7ab
commit 2ab31b05ba

View File

@ -210,9 +210,16 @@ void
g_cancel_event(void *ref)
{
struct g_event *ep, *epn;
struct g_provider *pp;
u_int n;
mtx_lock(&g_eventlock);
TAILQ_FOREACH(pp, &g_doorstep, orphan) {
if (pp != ref)
continue;
TAILQ_REMOVE(&g_doorstep, pp, orphan);
break;
}
for (ep = TAILQ_FIRST(&g_events); ep != NULL; ep = epn) {
epn = TAILQ_NEXT(ep, events);
for (n = 0; n < G_N_EVENTREFS; n++) {