pub struct PerThreadMutex { /* private fields */ }
Implementations§
Source§impl PerThreadMutex
impl PerThreadMutex
Sourcepub fn acquire(&self) -> PerThreadMutexGuard<'_>
pub fn acquire(&self) -> PerThreadMutexGuard<'_>
Acquire a per-thread lock.
The lock keeps track of the thread ID from which it is called. If a second acquire is called
from the same mutex, acquire()
will grant a lock to that caller as well. Number of
acquisitions is tracked internally and the lock will be released when all acquisitions are
dropped.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for PerThreadMutex
impl RefUnwindSafe for PerThreadMutex
impl Send for PerThreadMutex
impl Sync for PerThreadMutex
impl Unpin for PerThreadMutex
impl UnwindSafe for PerThreadMutex
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