| 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 | { |
no test coverage detected