Struct sgx_sync::MovableMutex
source · [−]pub struct MovableMutex(_);
Expand description
An SGX-based mutual exclusion lock.
This mutex cleans up its resources in its Drop
implementation, may safely
be moved (when not borrowed), and does not cause UB when used reentrantly.
This mutex does not implement poisoning.
This is either a wrapper around LazyBox<imp::Mutex>
or imp::Mutex
,
depending on the platform. It is boxed on platforms where imp::Mutex
may
not be moved.
Implementations
sourceimpl MovableMutex
impl MovableMutex
sourcepub const fn new() -> MovableMutex
pub const fn new() -> MovableMutex
Creates a new mutex.
sourcepub fn try_lock(&self) -> bool
pub fn try_lock(&self) -> bool
Attempts to lock the mutex without blocking, returning whether it was successfully acquired or not.
sourcepub unsafe fn raw_unlock(&self)
pub unsafe fn raw_unlock(&self)
Unlocks the mutex.
Behavior is undefined if the current thread does not actually hold the mutex.
Trait Implementations
sourceimpl Default for MovableMutex
impl Default for MovableMutex
sourcefn default() -> MovableMutex
fn default() -> MovableMutex
Returns the “default value” for a type. Read more
sourceimpl RawMutex for MovableMutex
impl RawMutex for MovableMutex
impl Sync for MovableMutex
Auto Trait Implementations
impl RefUnwindSafe for MovableMutex
impl Send for MovableMutex
impl Unpin for MovableMutex
impl UnwindSafe for MovableMutex
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more