mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-02-05 20:43:48 +01:00
don't wait for completion explicitly
This commit is contained in:
parent
1bff42042d
commit
774c606b09
1 changed files with 2 additions and 7 deletions
|
@ -78,8 +78,8 @@ namespace i2p
|
||||||
m_Service->Stop ();
|
m_Service->Stop ();
|
||||||
CleanUp (); // GarlicDestination
|
CleanUp (); // GarlicDestination
|
||||||
}
|
}
|
||||||
if (m_SavingRouterInfo.valid () && m_SavingRouterInfo.wait_for(std::chrono::seconds(0)) != std::future_status::ready)
|
if (m_SavingRouterInfo.valid ())
|
||||||
m_SavingRouterInfo.wait ();
|
m_SavingRouterInfo.get ();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<i2p::data::RouterInfo::Buffer> RouterContext::CopyRouterInfoBuffer () const
|
std::shared_ptr<i2p::data::RouterInfo::Buffer> RouterContext::CopyRouterInfoBuffer () const
|
||||||
|
@ -265,12 +265,7 @@ namespace i2p
|
||||||
m_LastUpdateTime = i2p::util::GetSecondsSinceEpoch ();
|
m_LastUpdateTime = i2p::util::GetSecondsSinceEpoch ();
|
||||||
// defer saving buffer to disk
|
// defer saving buffer to disk
|
||||||
if (m_SavingRouterInfo.valid ())
|
if (m_SavingRouterInfo.valid ())
|
||||||
{
|
|
||||||
if (m_SavingRouterInfo.wait_for(std::chrono::seconds(0)) != std::future_status::ready)
|
|
||||||
// wait until previous update complete
|
|
||||||
m_SavingRouterInfo.wait ();
|
|
||||||
m_SavingRouterInfo.get ();
|
m_SavingRouterInfo.get ();
|
||||||
}
|
|
||||||
m_SavingRouterInfo = std::async (std::launch::async,
|
m_SavingRouterInfo = std::async (std::launch::async,
|
||||||
[buffer = std::move(buffer)]()
|
[buffer = std::move(buffer)]()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue