pub struct LockManager { /* private fields */ }Expand description
The key and predicate lock manager. Cheap to share: all state lives behind one mutex and one condition variable.
Implementations§
Source§impl LockManager
impl LockManager
pub fn new() -> Self
Sourcepub fn acquire(
&self,
key: LockKey,
request: LockRequest,
) -> Result<(), LockError>
pub fn acquire( &self, key: LockKey, request: LockRequest, ) -> Result<(), LockError>
Acquires key for request.txn_id, blocking until granted, doomed,
cancelled, or past the deadline. See the module docs for the
re-entrancy, upgrade, fairness, and deadlock rules.
Sourcepub fn release(&self, txn_id: u64, key: &LockKey)
pub fn release(&self, txn_id: u64, key: &LockKey)
Releases every hold txn_id has on key, granting queued waiters.
Releasing a key the transaction does not hold is a no-op.
Sourcepub fn release_all(&self, txn_id: u64)
pub fn release_all(&self, txn_id: u64)
Releases every hold and pending wait of txn_id; called exactly once
when the transaction ends, including on abort as a deadlock victim.
Trait Implementations§
Source§impl Debug for LockManager
impl Debug for LockManager
Auto Trait Implementations§
impl !Freeze for LockManager
impl !RefUnwindSafe for LockManager
impl !UnwindSafe for LockManager
impl Send for LockManager
impl Sync for LockManager
impl Unpin for LockManager
impl UnsafeUnpin for LockManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more