···c++
struct Loop {
int epfd;
int numPolls = 0;
bool cancelledLastTimer;
int delay = -1; epoll_event readyEvents[1024]; std::chrono::system_clock::time_point timepoint; std::vector timers; std::vector> closing; void (*preCb)(void *) = nullptr; void (*postCb)(void *) = nullptr; void *preCbData, *postCbData; Loop(bool defaultLoop) { epfd = epoll_create1(EPOLL_CLOEXEC);timepoint = std::chrono::system_clock::now(); } static Loop *createLoop(bool defaultLoop = true) { return new Loop(defaultLoop); } void destroy() { ::close(epfd); delete this; }
···
## 舸