MCPcopy Create free account
hub / github.com/defold/defold / PollerSetEvent

Function PollerSetEvent

engine/dlib/src/dlib/file_descriptor.cpp:43–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41 }
42
43 void PollerSetEvent(Poller* poller, PollEvent event, int fd)
44 {
45 int e = PollEventToNative(event);
46 for (uint32_t i = 0; i < poller->m_Pollfds.Size(); ++i)
47 {
48 if (poller->m_Pollfds[i].fd == fd)
49 {
50 poller->m_Pollfds[i].events |= e;
51 return;
52 }
53 }
54
55 if (poller->m_Pollfds.Full())
56 {
57 poller->m_Pollfds.OffsetCapacity(4);
58 }
59
60 PollFD pfd;
61 pfd.fd = fd;
62 pfd.events = e;
63 poller->m_Pollfds.Push(pfd);
64 }
65
66 bool PollerHasEvent(Poller* poller, PollEvent event, int fd)
67 {

Callers 2

RecvTimeoutFunction · 0.85
SelectorSetFunction · 0.85

Calls 5

PollEventToNativeFunction · 0.70
SizeMethod · 0.45
FullMethod · 0.45
OffsetCapacityMethod · 0.45
PushMethod · 0.45

Tested by

no test coverage detected