pub(crate) struct CoreLatch {
state: AtomicUsize,
}
Expand description
Spin latches are the simplest, most efficient kind, but they do
not support a wait()
operation. They just have a boolean flag
that becomes true when set()
is called.
Fields§
§state: AtomicUsize
Implementations§
Source§impl CoreLatch
impl CoreLatch
fn new() -> Self
Sourcepub(crate) fn get_sleepy(&self) -> bool
pub(crate) fn get_sleepy(&self) -> bool
Invoked by owning thread as it prepares to sleep. Returns true if the owning thread may proceed to fall asleep, false if the latch was set in the meantime.
Sourcepub(crate) fn fall_asleep(&self) -> bool
pub(crate) fn fall_asleep(&self) -> bool
Invoked by owning thread as it falls asleep sleep. Returns true if the owning thread should block, or false if the latch was set in the meantime.
Sourcepub(crate) fn wake_up(&self)
pub(crate) fn wake_up(&self)
Invoked by owning thread as it falls asleep sleep. Returns true if the owning thread should block, or false if the latch was set in the meantime.
Trait Implementations§
Source§impl AsCoreLatch for CoreLatch
impl AsCoreLatch for CoreLatch
fn as_core_latch(&self) -> &CoreLatch
Auto Trait Implementations§
impl !Freeze for CoreLatch
impl RefUnwindSafe for CoreLatch
impl Send for CoreLatch
impl Sync for CoreLatch
impl Unpin for CoreLatch
impl UnwindSafe for CoreLatch
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
Source§impl<T> Pointable for T
impl<T> Pointable for T
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 8 bytes