pub struct ShardedLockTable { /* private fields */ }Expand description
Sharded lock table for row-level locks 256 shards reduce contention by ~256x for uniform key distribution
Implementations§
Source§impl ShardedLockTable
impl ShardedLockTable
Sourcepub fn try_lock(
&self,
row_id: RowId,
mode: LockMode,
txn_id: TxnId,
) -> LockResult
pub fn try_lock( &self, row_id: RowId, mode: LockMode, txn_id: TxnId, ) -> LockResult
Try to acquire a lock on a row
Sourcepub fn unlock_all(&self, txn_id: TxnId) -> usize
pub fn unlock_all(&self, txn_id: TxnId) -> usize
Release all locks held by a transaction
Sourcepub fn stats(&self) -> &LockTableStats
pub fn stats(&self) -> &LockTableStats
Get statistics
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ShardedLockTable
impl !RefUnwindSafe for ShardedLockTable
impl Send for ShardedLockTable
impl Sync for ShardedLockTable
impl Unpin for ShardedLockTable
impl UnwindSafe for ShardedLockTable
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