diff options
| author | tv <tv@krebsco.de> | 2026-10-26 04:20:52 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-10-26 04:20:52 +0100 |
| commit | 7b7dcb5a77061cb69d368de263a02b5ad26fbf51 (patch) | |
| tree | d3255ce629cb60059cb55191dc206d0f64ca645e /src/swarm/sync.rs | |
| parent | d668ce2ff8f308e54c1c7a2c145cb3479cab899d (diff) | |
unify lock logic
Diffstat (limited to 'src/swarm/sync.rs')
| -rw-r--r-- | src/swarm/sync.rs | 4 |
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(); |
