| 69 | } |
| 70 | |
| 71 | void PidFdWaiter::Stop() |
| 72 | { |
| 73 | if (thread_ != nullptr) { |
| 74 | XASSERT(!eventfd_write(event_fd_, 1), "fail to write event fd"); |
| 75 | thread_->join(); |
| 76 | thread_ = nullptr; |
| 77 | } |
| 78 | |
| 79 | if (event_fd_ >= 0) close(event_fd_); |
| 80 | if (epoll_fd_ >= 0) close(epoll_fd_); |
| 81 | for (auto& it : pid_fds_) { close(it.second); } |
| 82 | |
| 83 | event_fd_ = -1; |
| 84 | epoll_fd_ = -1; |
| 85 | pid_fds_.clear(); |
| 86 | } |
| 87 | |
| 88 | void PidFdWaiter::AddWait(PID pid) |
| 89 | { |
no outgoing calls
no test coverage detected