MCPcopy Create free account
hub / github.com/3rdparty/libprocess / discard_poll

Function discard_poll

src/posix/libev/libev_poll.cpp:67–86  ·  view source on GitHub ↗

Event loop callback when future associated with polling file descriptor has been discarded.

Source from the content-addressed store, hash-verified

65// Event loop callback when future associated with polling file
66// descriptor has been discarded.
67void discard_poll(struct ev_loop* loop, ev_async* watcher, int revents)
68{
69 Poll* poll = (Poll*) watcher->data;
70
71 // Check and see if we have a pending 'polled' callback and if so
72 // let it "win".
73 if (ev_is_pending(poll->watcher.io.get())) {
74 return;
75 }
76
77 ev_async_stop(loop, poll->watcher.async.get());
78
79 // Stop the I/O watcher (but note we check if pending above) so it
80 // won't get invoked and we can delete 'poll' here.
81 ev_io_stop(loop, poll->watcher.io.get());
82
83 poll->promise.discard();
84
85 delete poll;
86}
87
88
89namespace io {

Callers

nothing calls this directly

Calls 2

getMethod · 0.45
discardMethod · 0.45

Tested by

no test coverage detected