summaryrefslogtreecommitdiffstats
path: root/src/state/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/state/mod.rs')
-rw-r--r--src/state/mod.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/state/mod.rs b/src/state/mod.rs
index c5a6885..3336b00 100644
--- a/src/state/mod.rs
+++ b/src/state/mod.rs
@@ -30,6 +30,7 @@ use tokio::time::Instant;
use tracing::{debug, error, warn};
use crate::document::replica::{Epoch, Replica};
+use crate::locks::MutexExt;
use crate::remake::{Host, RemakeState};
use crate::swarm::sync::{ChangeSet, SyncEvent};
use crate::swarm::throughput::ThroughputTable;
@@ -174,9 +175,7 @@ impl AppState {
}
pub(crate) fn lock_rtt(&self) -> std::sync::MutexGuard<'_, crate::swarm::rtt::RttTable> {
- self.rtt
- .lock()
- .unwrap_or_else(|poisoned| poisoned.into_inner())
+ self.rtt.lock_or_recover()
}
/// The local epoch. Code that labels or applies sync messages must use the epoch