pub struct Mutex { /* private fields */ }Expand description
RAII wrapper around ove_mutex_t.
Implementations§
Source§impl Mutex
impl Mutex
Sourcepub fn lock(&self, timeout_ms: u32) -> Result<()>
pub fn lock(&self, timeout_ms: u32) -> Result<()>
Lock with a timeout in milliseconds. Use WAIT_FOREVER for no timeout.
§Errors
Returns Error::Timeout if the mutex cannot be acquired within timeout_ms.
Sourcepub fn guard(&self, timeout_ms: u32) -> Result<MutexGuard<'_>>
pub fn guard(&self, timeout_ms: u32) -> Result<MutexGuard<'_>>
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§
Auto Trait Implementations§
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