| 97 | } |
| 98 | |
| 99 | void Cleanup(size_t threadNum) { |
| 100 | if (Options.nListenerThreads < 2) { |
| 101 | return; |
| 102 | } |
| 103 | |
| 104 | TIntrusiveListWithAutoDelete<TClientConnection, TDelete> toDelete; |
| 105 | |
| 106 | { |
| 107 | TGuard<TMutex> g(Mutex_); |
| 108 | |
| 109 | PendingDelete_.ForEach([&toDelete, threadNum](TClientConnection * conn) { |
| 110 | if (!(conn->CleanupState_.ThreadMask &= ~((ui64)1 << threadNum))) { |
| 111 | toDelete.PushBack(conn); |
| 112 | } |
| 113 | }); |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | |
| 118 | inline void Erase(TClientConnection* c, TInstant now) noexcept { |
no test coverage detected