MCPcopy Create free account
hub / github.com/XpuOS/xsched / Start

Method Start

utils/src/waitpid.cpp:55–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55void PidFdWaiter::Start()
56{
57 event_fd_ = eventfd(0, EFD_CLOEXEC);
58 XASSERT(event_fd_ >= 0, "fail to create event fd");
59 epoll_fd_ = epoll_create1(EPOLL_CLOEXEC);
60 XASSERT(epoll_fd_ >= 0, "fail to create epoll fd");
61
62 struct epoll_event ev;
63 ev.events = EPOLLIN;
64 ev.data.u64 = PackEventData(kEpollEventTerminate, 0);
65 XASSERT(!epoll_ctl(epoll_fd_, EPOLL_CTL_ADD, event_fd_, &ev),
66 "fail to add event fd to epoll");
67
68 thread_ = std::make_unique<std::thread>(&PidFdWaiter::WaitWorker, this);
69}
70
71void PidFdWaiter::Stop()
72{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected