MCPcopy Create free account
hub / github.com/catboost/catboost / Poll

Method Poll

library/cpp/coroutine/engine/impl.cpp:206–231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204}
205
206void TContExecutor::Poll(TInstant deadline) {
207 Poller_.Wait(PollerEvents_, deadline);
208 LastPoll_ = Now();
209
210 // Waking a coroutine puts it into ReadyNext_ list
211 for (auto event : PollerEvents_) {
212 auto* lst = (NCoro::TPollEventList*)event.Data;
213 const int status = event.Status;
214
215 if (status) {
216 for (auto it = lst->Begin(); it != lst->End();) {
217 (it++)->OnPollEvent(status);
218 }
219 } else {
220 const ui16 filter = event.Filter;
221
222 for (auto it = lst->Begin(); it != lst->End();) {
223 if (it->What() & filter) {
224 (it++)->OnPollEvent(0);
225 } else {
226 ++it;
227 }
228 }
229 }
230 }
231}
232
233void TContExecutor::Abort() noexcept {
234 WaitQueue_.Abort();

Callers

nothing calls this directly

Calls 6

WhatMethod · 0.80
NowFunction · 0.50
WaitMethod · 0.45
BeginMethod · 0.45
EndMethod · 0.45
OnPollEventMethod · 0.45

Tested by

no test coverage detected