Browse Source

detach tunnles from poll

pull/102/head
orignal 10 years ago
parent
commit
2ab597be20
  1. 6
      Tunnel.cpp
  2. 9
      TunnelPool.cpp
  3. 3
      TunnelPool.h

6
Tunnel.cpp

@ -297,7 +297,11 @@ namespace tunnel @@ -297,7 +297,11 @@ namespace tunnel
void Tunnels::DeleteTunnelPool (TunnelPool * pool)
{
if (pool) pool->SetDeleted ();
if (pool)
{
pool->DetachTunnels ();
pool->SetDeleted ();
}
}
void Tunnels::AddTransitTunnel (TransitTunnel * tunnel)

9
TunnelPool.cpp

@ -17,6 +17,11 @@ namespace tunnel @@ -17,6 +17,11 @@ namespace tunnel
}
TunnelPool::~TunnelPool ()
{
DetachTunnels ();
}
void TunnelPool::DetachTunnels ()
{
{
std::unique_lock<std::mutex> l(m_InboundTunnelsMutex);
@ -28,8 +33,8 @@ namespace tunnel @@ -28,8 +33,8 @@ namespace tunnel
for (auto it: m_OutboundTunnels)
it->SetTunnelPool (nullptr);
}
}
}
void TunnelPool::TunnelCreated (InboundTunnel * createdTunnel)
{
{

3
TunnelPool.h

@ -49,7 +49,8 @@ namespace tunnel @@ -49,7 +49,8 @@ namespace tunnel
void ProcessDeliveryStatus (I2NPMessage * msg);
bool IsDeleted () const { return m_IsDeleted; };
void SetDeleted () { m_IsDeleted = true; }
void SetDeleted () { m_IsDeleted = true; };
void DetachTunnels ();
private:

Loading…
Cancel
Save