Browse Source

fixed race condition

pull/1553/merge
orignal 4 years ago
parent
commit
3b630fe546
  1. 2
      libi2pd/TunnelPool.cpp

2
libi2pd/TunnelPool.cpp

@ -292,6 +292,8 @@ namespace tunnel
} }
// new tests // new tests
std::unique_lock<std::mutex> l1(m_OutboundTunnelsMutex);
std::unique_lock<std::mutex> l2(m_InboundTunnelsMutex);
auto it1 = m_OutboundTunnels.begin (); auto it1 = m_OutboundTunnels.begin ();
auto it2 = m_InboundTunnels.begin (); auto it2 = m_InboundTunnels.begin ();
while (it1 != m_OutboundTunnels.end () && it2 != m_InboundTunnels.end ()) while (it1 != m_OutboundTunnels.end () && it2 != m_InboundTunnels.end ())

Loading…
Cancel
Save