prevent deadlock

This commit is contained in:
Grant Limberg 2023-05-03 16:26:09 -07:00
parent ff2a9c88f0
commit f548905db4
No known key found for this signature in database
GPG key ID: 8F2F97D3BE8D7735

View file

@ -520,6 +520,7 @@ void Peer::performMultipathStateCheck(void *tPtr, int64_t now)
unsigned int Peer::doPingAndKeepalive(void *tPtr,int64_t now)
{
unsigned int sent = 0;
{
Mutex::Lock _l(_paths_m);
performMultipathStateCheck(tPtr, now);
@ -581,6 +582,7 @@ unsigned int Peer::doPingAndKeepalive(void *tPtr,int64_t now)
}
_alive_path_count = alive_path_count_tmp;
_dead_path_count = dead_path_count_tmp;
}
_peer_latency.Observe(latency(now));
return sent;
}