mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 13:27:17 +01:00
fixed potential race condition
This commit is contained in:
parent
58245bf121
commit
0710f62948
|
@ -1336,8 +1336,11 @@ namespace transport
|
|||
|
||||
// exclude all existing sessions
|
||||
excluded.clear ();
|
||||
{
|
||||
std::lock_guard<std::mutex> l(m_SessionsByRouterHashMutex);
|
||||
for (const auto& [ident, s] : m_SessionsByRouterHash)
|
||||
excluded.insert (ident);
|
||||
}
|
||||
|
||||
// sesssion about to expire are not counted
|
||||
for (auto i = introducers.size (); i < SSU2_MAX_NUM_INTRODUCERS + numOldSessions; i++)
|
||||
|
|
Loading…
Reference in a new issue