Decreased the scope of read mutex

This commit is contained in:
Anonymous-275
2021-03-31 00:05:05 +03:00
parent 24994d7dde
commit f323d50e34
6 changed files with 97 additions and 64 deletions

View File

@@ -48,7 +48,6 @@ std::weak_ptr<TClient> TServer::InsertNewClient() {
}
void TServer::ForEachClient(const std::function<bool(std::weak_ptr<TClient>)>& Fn) {
ReadLock Lock(mClientsMutex);
for (auto& Client : mClients) {
if (!Fn(Client)) {
break;