MCPcopy Create free account
hub / github.com/aui-framework/aui / loop

Method loop

aui.core/src/AUI/Platform/unix/UnixIoThread.cpp:49–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47 }
48
49 void loop() override {
50 for (;;) {
51 AThread::processMessages();
52 epoll_event events[1024];
53 int count = epoll_wait(mParent.mEpollFd, events, std::size(events), -1);
54 if (count < 0) {
55 if (errno == EINTR) {
56 continue;
57 }
58 aui::impl::unix_based::lastErrorToException("epoll_wait failed");
59 }
60 std::unique_lock lock (mParent.mSync);
61 for (int i = 0; i < count; ++i) {
62 auto it = mParent.mFdInfo.find(events[i].data.fd);
63 if (it == mParent.mFdInfo.end()) continue;
64 for (const auto& callback : it->second.callbacks) {
65 if (!callback.mask.testAny(static_cast<UnixPollEvent>(events[i].events))) {
66 continue;
67 }
68 callback.callback(static_cast<UnixPollEvent>(events[i].events));
69 }
70 }
71 }
72 }
73private:
74 UnixIoThread& mParent;
75};

Callers 1

UnixIoThreadMethod · 0.45

Calls 9

processMessagesFunction · 0.85
callbackFunction · 0.85
testAnyMethod · 0.80
sizeFunction · 0.50
findMethod · 0.45
endMethod · 0.45
processMessagesMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected