MCPcopy Create free account
hub / github.com/F-Stack/f-stack / kqueue_wakeup

Function kqueue_wakeup

freebsd/kern/kern_event.c:2211–2234  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2209}
2210
2211static void
2212kqueue_wakeup(struct kqueue *kq)
2213{
2214 KQ_OWNED(kq);
2215
2216 if ((kq->kq_state & KQ_SLEEP) == KQ_SLEEP) {
2217 kq->kq_state &= ~KQ_SLEEP;
2218 wakeup(kq);
2219 }
2220 if ((kq->kq_state & KQ_SEL) == KQ_SEL) {
2221 selwakeuppri(&kq->kq_sel, PSOCK);
2222 if (!SEL_WAITING(&kq->kq_sel))
2223 kq->kq_state &= ~KQ_SEL;
2224 }
2225 if (!knlist_empty(&kq->kq_sel.si_note))
2226#ifndef FSTACK
2227 kqueue_schedtask(kq);
2228#else
2229 KNOTE_UNLOCKED(&kq->kq_sel.si_note, 0);
2230#endif
2231 if ((kq->kq_state & KQ_ASYNC) == KQ_ASYNC) {
2232 pgsigio(&kq->kq_sigio, SIGIO, 0);
2233 }
2234}
2235
2236/*
2237 * Walk down a list of knotes, activating them if their event has triggered.

Callers 1

knote_enqueueFunction · 0.85

Calls 5

selwakeuppriFunction · 0.85
knlist_emptyFunction · 0.85
kqueue_schedtaskFunction · 0.85
wakeupFunction · 0.70
pgsigioFunction · 0.70

Tested by

no test coverage detected