Lines Matching refs:reactable
128 auto* reactable = static_cast<Reactor::Reactable*>(event.data.ptr); in Run() local
132 …if (std::find(invalidation_list_.begin(), invalidation_list_.end(), reactable) != invalidation_lis… in Run()
137 std::lock_guard<std::mutex> reactable_lock(reactable->mutex_); in Run()
139 reactable->is_executing_ = true; in Run()
141 …if (event.events & (EPOLLIN | EPOLLHUP | EPOLLRDHUP | EPOLLERR) && !reactable->on_read_ready_.is_n… in Run()
142 reactable->on_read_ready_.Run(); in Run()
144 if (event.events & EPOLLOUT && !reactable->on_write_ready_.is_null()) { in Run()
145 reactable->on_write_ready_.Run(); in Run()
148 std::unique_lock<std::mutex> reactable_lock(reactable->mutex_); in Run()
149 reactable->is_executing_ = false; in Run()
150 if (reactable->removed_) { in Run()
151 reactable->finished_promise_->set_value(); in Run()
153 delete reactable; in Run()
176 auto* reactable = new Reactable(fd, on_read_ready, on_write_ready); in Register() local
179 .data = {.ptr = reactable}, in Register()
184 return reactable; in Register()
187 void Reactor::Unregister(Reactor::Reactable* reactable) { in Unregister() argument
188 ASSERT(reactable != nullptr); in Unregister()
191 invalidation_list_.push_back(reactable); in Unregister()
196 std::lock_guard<std::mutex> reactable_lock(reactable->mutex_); in Unregister()
197 RUN_NO_INTR(result = epoll_ctl(epoll_fd_, EPOLL_CTL_DEL, reactable->fd_, nullptr)); in Unregister()
206 if (reactable->is_executing_) { in Unregister()
207 reactable->removed_ = true; in Unregister()
208 reactable->finished_promise_ = std::make_unique<std::promise<void>>(); in Unregister()
209 …executing_reactable_finished_ = std::make_shared<std::future<void>>(reactable->finished_promise_->… in Unregister()
215 delete reactable; in Unregister()
246 void Reactor::ModifyRegistration(Reactor::Reactable* reactable, Closure on_read_ready, Closure on_w… in ModifyRegistration() argument
247 ASSERT(reactable != nullptr); in ModifyRegistration()
257 std::lock_guard<std::mutex> reactable_lock(reactable->mutex_); in ModifyRegistration()
258 reactable->on_read_ready_ = std::move(on_read_ready); in ModifyRegistration()
259 reactable->on_write_ready_ = std::move(on_write_ready); in ModifyRegistration()
263 .data = {.ptr = reactable}, in ModifyRegistration()
266 RUN_NO_INTR(modify_fd = epoll_ctl(epoll_fd_, EPOLL_CTL_MOD, reactable->fd_, &event)); in ModifyRegistration()