pub struct LockTable { /* private fields */ }Expand description
Sharded per-record write-lock registry. Cloning is cheap (one
Arc per shard map) so the table can live behind an Arc shared
across all writers.
Implementations§
Source§impl LockTable
impl LockTable
pub fn new() -> Self
Sourcepub fn node_lock_arc(&self, id: NodeId) -> Arc<Mutex<()>>
pub fn node_lock_arc(&self, id: NodeId) -> Arc<Mutex<()>>
Look up (or insert) the per-node Arc<Mutex<()>>. Caller is
expected to lock() the returned Arc and hold it across the
mutation. Sharded so two threads locking different node ids in
the same id-mod-shards bucket only contend for the brief
shard-table acquisition, not on each other’s record lock.
Sourcepub fn rel_lock_arc(&self, id: RelationshipId) -> Arc<Mutex<()>>
pub fn rel_lock_arc(&self, id: RelationshipId) -> Arc<Mutex<()>>
Same as Self::node_lock_arc but for relationships.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for LockTable
impl RefUnwindSafe for LockTable
impl Send for LockTable
impl Sync for LockTable
impl Unpin for LockTable
impl UnsafeUnpin for LockTable
impl UnwindSafe for LockTable
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