mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-10 00:00:29 +03:00
fixed deadlock
This commit is contained in:
parent
940628bf36
commit
285e693a4e
@ -365,15 +365,19 @@ namespace tunnel
|
|||||||
{
|
{
|
||||||
it.second.second->SetState (eTunnelStateFailed);
|
it.second.second->SetState (eTunnelStateFailed);
|
||||||
{
|
{
|
||||||
std::unique_lock<std::mutex> l(m_InboundTunnelsMutex);
|
bool failed = false;
|
||||||
if (m_InboundTunnels.size () > 1 || m_NumInboundTunnels <= 1) // don't fail last tunnel
|
|
||||||
{
|
{
|
||||||
m_InboundTunnels.erase (it.second.second);
|
std::unique_lock<std::mutex> l(m_InboundTunnelsMutex);
|
||||||
if (m_LocalDestination)
|
if (m_InboundTunnels.size () > 1 || m_NumInboundTunnels <= 1) // don't fail last tunnel
|
||||||
m_LocalDestination->SetLeaseSetUpdated ();
|
{
|
||||||
|
m_InboundTunnels.erase (it.second.second);
|
||||||
|
failed = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
it.second.second->SetState (eTunnelStateTestFailed);
|
||||||
}
|
}
|
||||||
else
|
if (failed && m_LocalDestination)
|
||||||
it.second.second->SetState (eTunnelStateTestFailed);
|
m_LocalDestination->SetLeaseSetUpdated ();
|
||||||
}
|
}
|
||||||
if (m_LocalDestination)
|
if (m_LocalDestination)
|
||||||
m_LocalDestination->SetLeaseSetUpdated ();
|
m_LocalDestination->SetLeaseSetUpdated ();
|
||||||
|
Loading…
Reference in New Issue
Block a user