diff --git a/crdt-enc/src/lib.rs b/crdt-enc/src/lib.rs index 21a681e..01bfbf3 100644 --- a/crdt-enc/src/lib.rs +++ b/crdt-enc/src/lib.rs @@ -204,8 +204,6 @@ pub struct Core { storage: ST, cryptor: C, key_cryptor: KC, - // use sync `std::sync::Mutex` here because it has less overhead than async mutex, we are - // holding it for a very shot time and do not `.await` while the lock is held. data: LockBox>, supported_data_versions: Vec, current_data_version: Uuid, diff --git a/crdt-enc/src/utils.rs b/crdt-enc/src/utils.rs index 9627917..46edea4 100644 --- a/crdt-enc/src/utils.rs +++ b/crdt-enc/src/utils.rs @@ -126,7 +126,9 @@ where Ok(()) } -/// Prevents `await`s while the lock is held. Awaiting could cause deadlocking. +/// Uses sync `std::sync::Mutex` because it has less overhead than async mutex. Its intended use is +/// for short data accesses. Prevents `await`s while the lock is held. Awaiting could cause +/// deadlocking. #[derive(Debug)] pub struct LockBox { inner: SyncMutex,