aboutsummaryrefslogtreecommitdiffstats
path: root/src/swarm/sync.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-26 04:20:52 +0100
committertv <tv@krebsco.de>2026-10-26 04:20:52 +0100
commit2ff446bdb5c5b82b653eac822061aaeb686c3ccc (patch)
tree24b34021a6f4f2029c59c7909c5174ad29136a69 /src/swarm/sync.rs
parent735b27ad691f768027d6034a3f50efbd68feda89 (diff)
unify lock logic
Diffstat (limited to 'src/swarm/sync.rs')
-rw-r--r--src/swarm/sync.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/swarm/sync.rs b/src/swarm/sync.rs
index a05e346..fc6dc43 100644
--- a/src/swarm/sync.rs
+++ b/src/swarm/sync.rs
@@ -11,6 +11,7 @@ use tokio::sync::mpsc;
use tokio::time::Instant;
use tracing::{debug, info, trace, warn};
+use crate::locks::MutexExt;
use crate::state::{AppState, Liveness, Sending, Standing};
use crate::swarm::peer::{peer_swarm, send_hello_once};
use crate::swarm::source;
@@ -355,8 +356,7 @@ pub(crate) async fn handle_sync(
peer_state.last_sync_rx = Some(Instant::now());
if let Some(wait) = &peer_state.sync.reply {
throughput
- .lock()
- .unwrap_or_else(|poisoned| poisoned.into_inner())
+ .lock_or_recover()
.exchange(&peer, wait.started, arrived, rtt);
}
peer_state.sync.reply_settled();