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
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: 32 bytes