mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 21:37:17 +01:00
detach tunnles from poll
This commit is contained in:
parent
f34680134a
commit
2ab597be20
|
@ -297,7 +297,11 @@ namespace tunnel
|
||||||
|
|
||||||
void Tunnels::DeleteTunnelPool (TunnelPool * pool)
|
void Tunnels::DeleteTunnelPool (TunnelPool * pool)
|
||||||
{
|
{
|
||||||
if (pool) pool->SetDeleted ();
|
if (pool)
|
||||||
|
{
|
||||||
|
pool->DetachTunnels ();
|
||||||
|
pool->SetDeleted ();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Tunnels::AddTransitTunnel (TransitTunnel * tunnel)
|
void Tunnels::AddTransitTunnel (TransitTunnel * tunnel)
|
||||||
|
|
|
@ -17,6 +17,11 @@ namespace tunnel
|
||||||
}
|
}
|
||||||
|
|
||||||
TunnelPool::~TunnelPool ()
|
TunnelPool::~TunnelPool ()
|
||||||
|
{
|
||||||
|
DetachTunnels ();
|
||||||
|
}
|
||||||
|
|
||||||
|
void TunnelPool::DetachTunnels ()
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
std::unique_lock<std::mutex> l(m_InboundTunnelsMutex);
|
std::unique_lock<std::mutex> l(m_InboundTunnelsMutex);
|
||||||
|
@ -28,8 +33,8 @@ namespace tunnel
|
||||||
for (auto it: m_OutboundTunnels)
|
for (auto it: m_OutboundTunnels)
|
||||||
it->SetTunnelPool (nullptr);
|
it->SetTunnelPool (nullptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TunnelPool::TunnelCreated (InboundTunnel * createdTunnel)
|
void TunnelPool::TunnelCreated (InboundTunnel * createdTunnel)
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
|
|
|
@ -49,7 +49,8 @@ namespace tunnel
|
||||||
void ProcessDeliveryStatus (I2NPMessage * msg);
|
void ProcessDeliveryStatus (I2NPMessage * msg);
|
||||||
|
|
||||||
bool IsDeleted () const { return m_IsDeleted; };
|
bool IsDeleted () const { return m_IsDeleted; };
|
||||||
void SetDeleted () { m_IsDeleted = true; }
|
void SetDeleted () { m_IsDeleted = true; };
|
||||||
|
void DetachTunnels ();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue