-STG_LOCKER lock(&m_mutex);
-m_ipToDel.push_back(ip);
-}
-//-----------------------------------------------------------------------------
-void STG_PINGER::RealAddIP()
-{
-STG_LOCKER lock(&m_mutex);
-
-auto iter = m_ipToAdd.begin();
-while (iter != m_ipToAdd.end())
- {
- m_pingIP.insert(std::make_pair(*iter, 0));
- ++iter;
- }
-m_ipToAdd.erase(m_ipToAdd.begin(), m_ipToAdd.end());
-}
-//-----------------------------------------------------------------------------
-void STG_PINGER::RealDelIP()
-{
-STG_LOCKER lock(&m_mutex);
-
-auto iter = m_ipToDel.begin();
-while (iter != m_ipToDel.end())
- {
- auto treeIter = m_pingIP.find(*iter);
- if (treeIter != m_pingIP.end())
- m_pingIP.erase(treeIter);
-
- ++iter;
- }
-m_ipToDel.erase(m_ipToDel.begin(), m_ipToDel.end());
+ std::lock_guard lock(m_mutex);
+ auto it = m_pingIPs.find(ip);
+ if (it != m_pingIPs.end())
+ m_pingIPs.erase(it);