pub struct RecursiveMutex { /* private fields */ }Expand description
RAII wrapper around a recursive mutex.
Implementations§
Source§impl RecursiveMutex
impl RecursiveMutex
Sourcepub fn new() -> Result<Self>
pub fn new() -> Result<Self>
Create a new recursive mutex via heap allocation (only in heap mode).
Sourcepub fn lock(&self, timeout_ms: u32) -> Result<()>
pub fn lock(&self, timeout_ms: u32) -> Result<()>
Lock with a timeout in milliseconds.
The same thread may lock the mutex multiple times; each lock must be
paired with a corresponding unlock.
§Errors
Returns Error::Timeout if the lock cannot be acquired within timeout_ms.
Sourcepub fn guard(&self, timeout_ms: u32) -> Result<RecursiveMutexGuard<'_>>
pub fn guard(&self, timeout_ms: u32) -> Result<RecursiveMutexGuard<'_>>
Lock and return an RAII guard that auto-unlocks on drop.
§Errors
Returns Error::Timeout if the lock cannot be acquired within timeout_ms.
Trait Implementations§
Source§impl Debug for RecursiveMutex
impl Debug for RecursiveMutex
Source§impl Drop for RecursiveMutex
impl Drop for RecursiveMutex
impl Send for RecursiveMutex
impl Sync for RecursiveMutex
Auto Trait Implementations§
impl Freeze for RecursiveMutex
impl RefUnwindSafe for RecursiveMutex
impl Unpin for RecursiveMutex
impl UnwindSafe for RecursiveMutex
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