Lines Matching refs:std
37 std::lock_guard<std::mutex> lg(m_clientAccess);
48 void CmdExecutor::MainLoop(const std::string& socketName)
52 std::cerr << "Failed to init control socket ! \n";
55 std::cout << "Server started to listen !\n";
56 using namespace std::chrono_literals;
58 [this] (std::unique_ptr<Socket> handler) {
59 OnAcceptedConnection(std::move(handler));
67 void CmdExecutor::OnAcceptedConnection(std::unique_ptr<Socket> handler)
69 std::lock_guard<std::mutex> lg(m_clientAccess);
70 auto newVal = std::make_unique<ClientThread>();
73 newVal->m_clientThread = std::thread([this](std::unique_ptr<Socket> handler) {
74 ClientEventLoop(std::move(handler));
75 }, std::move(handler));
76 m_clients.push_back(std::move(newVal));
80 void CmdExecutor::ClientEventLoop(std::unique_ptr<Socket> handler)
84 std::lock_guard<std::mutex> lg(m_clientAccess);
85 clientInfoIt = std::find_if(m_clients.begin(), m_clients.end(),
86 [](const std::unique_ptr<ClientThread>& ct) {
87 return ct->m_clientThread.get_id() == std::this_thread::get_id();
91 std::cerr << "Failed to find client\n";
96 ServiceController serviceCtrl(std::move(handler), m_logCollector, m_hilogBuffer, m_kmsgBuffer);
99 std::lock_guard<std::mutex> ul(m_finishedClientAccess);
100 m_finishedClients.push_back(std::this_thread::get_id());
105 std::list<std::thread> threadsToJoin;
108 std::scoped_lock sl(m_finishedClientAccess, m_clientAccess);
110 auto clientInfoIt = std::find_if(m_clients.begin(), m_clients.end(),
111 [&threadId](const std::unique_ptr<ClientThread>& ct) {
115 threadsToJoin.push_back(std::move((*clientInfoIt)->m_clientThread));