[−][src]Struct spinning_top::RawSpinlock
Provides mutual exclusion based on spinning on an AtomicBool
.
It's recommended to use this type either combination with lock_api::Mutex
or
through the Spinlock
type.
Example
use lock_api::RawMutex; let lock = spinning_top::RawSpinlock::INIT; assert_eq!(lock.try_lock(), true); // lock it assert_eq!(lock.try_lock(), false); // can't be locked a second time lock.unlock(); // unlock it assert_eq!(lock.try_lock(), true); // now it can be locked again
Trait Implementations
impl Debug for RawSpinlock
[src]
impl RawMutex for RawSpinlock
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,