Module rayon_core::latch

source ·

Structs

  • CoreLatch 🔒
    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.
  • CountLatch 🔒
    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.
  • LatchRef 🔒
    &L without any implication of dereferenceable for Latch::set
  • LockLatch 🔒
    A Latch starts as false and eventually becomes true. You can block until it becomes true.
  • OnceLatch 🔒
    Once latches are used to implement one-time blocking, primarily for the termination flag of the threads in the pool.
  • SpinLatch 🔒
    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.

Enums

Constants

  • SET 🔒
    Latch is set.
  • SLEEPING 🔒
    Latch is not set, owning thread is asleep on this latch and must be awoken.
  • SLEEPY 🔒
    Latch is not set, owning thread is going to sleep on this latch (but has not yet fallen asleep).
  • UNSET 🔒
    Latch is not set, owning thread is awake

Traits

  • Latch 🔒
    We define various kinds of latches, which are all a primitive signaling mechanism. A latch starts as false. Eventually someone calls set() and it becomes true. You can test if it has been set by calling probe().