pub struct LockManager { /* private fields */ }Expand description
Hierarchical lock manager with table and row-level locks
Implementations§
Source§impl LockManager
impl LockManager
Sourcepub fn lock_table(
&self,
table_id: TableId,
mode: IntentLock,
txn_id: TxnId,
) -> LockResult
pub fn lock_table( &self, table_id: TableId, mode: IntentLock, txn_id: TxnId, ) -> LockResult
Acquire an intent lock on a table
Sourcepub fn unlock_table(&self, table_id: TableId, txn_id: TxnId) -> bool
pub fn unlock_table(&self, table_id: TableId, txn_id: TxnId) -> bool
Release a table-level lock
Sourcepub fn lock_row(
&self,
table_id: TableId,
row_id: RowId,
mode: LockMode,
txn_id: TxnId,
) -> LockResult
pub fn lock_row( &self, table_id: TableId, row_id: RowId, mode: LockMode, txn_id: TxnId, ) -> LockResult
Acquire a row-level lock
Sourcepub fn unlock_row(
&self,
table_id: TableId,
row_id: RowId,
txn_id: TxnId,
) -> bool
pub fn unlock_row( &self, table_id: TableId, row_id: RowId, txn_id: TxnId, ) -> bool
Release a row-level lock
Sourcepub fn release_all(&self, txn_id: TxnId) -> usize
pub fn release_all(&self, txn_id: TxnId) -> usize
Release all locks held by a transaction
Sourcepub fn enter_epoch(&self) -> u64
pub fn enter_epoch(&self) -> u64
Enter a new epoch (for epoch-based reclamation)
Sourcepub fn current_epoch(&self) -> u64
pub fn current_epoch(&self) -> u64
Get current epoch
Sourcepub fn stats(&self) -> &LockManagerStats
pub fn stats(&self) -> &LockManagerStats
Get statistics
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for LockManager
impl !RefUnwindSafe for LockManager
impl Send for LockManager
impl Sync for LockManager
impl Unpin for LockManager
impl !UnwindSafe 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