Struct rayon_core::latch::CountLatch
source · pub(crate) struct CountLatch {
counter: AtomicUsize,
kind: CountLatchKind,
}
Expand description
Counting latches are used to implement scopes. They track a
counter. Unlike other latches, calling set()
does not
necessarily make the latch be considered set()
; instead, it just
decrements the counter. The latch is only “set” (in the sense that
probe()
returns true) once the counter reaches zero.
Fields§
§counter: AtomicUsize
§kind: CountLatchKind
Implementations§
source§impl CountLatch
impl CountLatch
pub(crate) fn new(owner: Option<&WorkerThread>) -> Self
pub(crate) fn with_count(count: usize, owner: Option<&WorkerThread>) -> Self
pub(crate) fn increment(&self)
pub(crate) fn wait(&self, owner: Option<&WorkerThread>)
Trait Implementations§
source§impl Debug for CountLatch
impl Debug for CountLatch
Auto Trait Implementations§
impl !Freeze for CountLatch
impl !RefUnwindSafe for CountLatch
impl Send for CountLatch
impl Sync for CountLatch
impl Unpin for CountLatch
impl !UnwindSafe for CountLatch
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