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

Method EraseStale

library/cpp/coroutine/engine/sockpool.h:157–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155 }
156
157 void EraseStale(const TInstant& maxAge) noexcept {
158 TSockets toDelete;
159
160 {
161 TGuard<TMutex> guard(Mutex_);
162
163 for (TSockets::TIterator it = Pool_.Begin(); it != Pool_.End();) {
164 if (it->LastTouch() < maxAge) {
165 toDelete.PushBack(&*(it++));
166 } else {
167 ++it;
168 }
169 }
170 }
171 }
172
173 TPooledSocket Get(TConnectData* conn) {
174 TPooledSocket ret;

Callers

nothing calls this directly

Calls 3

BeginMethod · 0.45
EndMethod · 0.45
PushBackMethod · 0.45

Tested by

no test coverage detected