Struct rayon_core::latch::CoreLatch
source · 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
Mutably borrows from an owned value. Read more