pub struct AssumeUnlockable;
Expand description
§WARNING: AssumeUnlockable
may cause undefined behaviour without unsafe
code!
A dummy RawMutex
implementation to skip synchronization on single threaded systems.
§Safety
AssumeUnlockable
is highly unsafe and may cause undefined behaviour if multiple
threads enter a critical section it guards, even without explicit unsafe code.
Note that uncontended spin locks are cheap. Usage is only recommended on platforms that don’t have atomics or are exclusively single threaded.
Through no fault of its own, lock_api
’s API does not allow for safe
encapsulation of this functionality. This is a hack for backwards compatibility.
Trait Implementations§
Source§impl RawMutex for AssumeUnlockable
impl RawMutex for AssumeUnlockable
Source§const INIT: AssumeUnlockable = AssumeUnlockable
const INIT: AssumeUnlockable = AssumeUnlockable
Initial value for an unlocked mutex.
Source§type GuardMarker = GuardSend
type GuardMarker = GuardSend
Marker type which determines whether a lock guard should be
Send
. Use
one of the GuardSend
or GuardNoSend
helper types here.Auto Trait Implementations§
impl Freeze for AssumeUnlockable
impl RefUnwindSafe for AssumeUnlockable
impl Send for AssumeUnlockable
impl Sync for AssumeUnlockable
impl Unpin for AssumeUnlockable
impl UnwindSafe for AssumeUnlockable
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