Lines Matching full:ep
236 struct g_event *ep; in one_event() local
250 ep = TAILQ_FIRST(&g_events); in one_event()
251 if (ep == NULL) { in one_event()
255 ep->flag |= EV_INPROGRESS; in one_event()
258 ep->func(ep->arg, 0); in one_event()
262 TAILQ_REMOVE(&g_events, ep, events); in one_event()
263 ep->flag &= ~EV_INPROGRESS; in one_event()
264 if (ep->flag & EV_WAKEUP) { in one_event()
265 ep->flag |= EV_DONE; in one_event()
266 wakeup(ep); in one_event()
270 g_free(ep); in one_event()
301 struct g_event *ep, *epn; in g_cancel_event() local
312 TAILQ_FOREACH_SAFE(ep, &g_events, events, epn) { in g_cancel_event()
313 if (ep->flag & EV_INPROGRESS) in g_cancel_event()
316 if (ep->ref[n] == NULL) in g_cancel_event()
318 if (ep->ref[n] != ref) in g_cancel_event()
321 TAILQ_REMOVE(&g_events, ep, events); in g_cancel_event()
322 ep->func(ep->arg, EV_CANCEL); in g_cancel_event()
324 if (ep->flag & EV_WAKEUP) { in g_cancel_event()
325 ep->flag |= (EV_DONE|EV_CANCELED); in g_cancel_event()
326 wakeup(ep); in g_cancel_event()
328 g_free(ep); in g_cancel_event()
349 struct g_event *ep, va_list ap) in g_post_event_ep_va() argument
354 ep->flag = wuflag; in g_post_event_ep_va()
360 ep->ref[n] = p; in g_post_event_ep_va()
363 ep->func = func; in g_post_event_ep_va()
364 ep->arg = arg; in g_post_event_ep_va()
367 TAILQ_INSERT_TAIL(&g_events, ep, events); in g_post_event_ep_va()
375 g_post_event_ep(g_event_t *func, void *arg, struct g_event *ep, ...) in g_post_event_ep() argument
379 va_start(ap, ep); in g_post_event_ep()
380 g_post_event_ep_va(func, arg, 0, ep, ap); in g_post_event_ep()
388 struct g_event *ep; in g_post_event_x() local
394 ep = g_alloc_event(flag); in g_post_event_x()
395 if (ep == NULL) in g_post_event_x()
398 *epp = ep; in g_post_event_x()
399 g_post_event_ep_va(func, arg, wuflag, ep, ap); in g_post_event_x()
438 struct g_event *ep; in g_waitfor_event() local
445 error = g_post_event_x(func, arg, flag, EV_WAKEUP, &ep, ap); in g_waitfor_event()
451 while (!(ep->flag & EV_DONE)) in g_waitfor_event()
452 msleep(ep, &g_eventlock, PRIBIO, "g_waitfor_event", 0); in g_waitfor_event()
453 if (ep->flag & EV_CANCELED) in g_waitfor_event()
457 g_free(ep); in g_waitfor_event()