Crate latches

source ·
Expand description

An implementation collection of latches.

A latch is a downward counter which can be used to synchronize threads or coordinate tasks. The value of the counter is initialized on creation.

In contrast to Barrier, it is a one-shot phenomenon, that mean the counter will not be reset after reaching 0. Instead, it has the useful property that it does not make them wait for the counter to reach 0 by calling count_down() or arrive(). This also means that it can be decremented by a participating thread/task more than once.

Modules

  • futexfutex
    The futex implementation.
  • syncsync
    The sync implementation is the default implementation of threads.
  • tasktask
    The task implementation.

Enums

  • WaitTimeoutResultsync and std, or task
    A type indicating whether a timed wait on a latch returned due to a time out or not.