ark::concurrency::AtomicCondition

Defined in header “ark/concurrency/atomic_condition.hh”.


A simple wrapper around futexes that allows you to wait on a condition (this class) until it is notified/signaled. It works without a mutex. If you signal the class, it will remain signaled until wait() is called.

Methods

  • void wait()
    If this condition is not signaled, it will go to sleep until signaled. Otherwise, it just returns. Does not protect against spurious wakeups. Resets the signal when it awakens.

  • void signal_one()
    Sets the condition as active and notifies one thread that is currently waiting on it.

  • void signal_forever()
    Signals this condition forever. Anyone waiting will wake up, and nobody will wait again. Typically used during shutdown.