docs: fix comments
This commit is contained in:
@@ -204,8 +204,6 @@ pub struct Core<S, ST, C, KC> {
|
|||||||
storage: ST,
|
storage: ST,
|
||||||
cryptor: C,
|
cryptor: C,
|
||||||
key_cryptor: KC,
|
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<CoreMutData<S>>,
|
data: LockBox<CoreMutData<S>>,
|
||||||
supported_data_versions: Vec<Uuid>,
|
supported_data_versions: Vec<Uuid>,
|
||||||
current_data_version: Uuid,
|
current_data_version: Uuid,
|
||||||
|
|||||||
@@ -126,7 +126,9 @@ where
|
|||||||
Ok(())
|
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)]
|
#[derive(Debug)]
|
||||||
pub struct LockBox<T> {
|
pub struct LockBox<T> {
|
||||||
inner: SyncMutex<T>,
|
inner: SyncMutex<T>,
|
||||||
|
|||||||
Reference in New Issue
Block a user