Conditional variable.
This is a standard computer science condition variable sans locking, since in seastar access to variables is atomic anyway, adapted for futures. You can wait for variable to be notified.
To support exceptional conditions, a broken() method is provided, which causes all current waiters to stop waiting, with an exceptional future returned. This allows causing all fibers that are blocked on a condition variable to continue. This issimilar to POSIX's pthread_cancel()
, with wait() acting as a cancellation point.
|
| condition_variable () noexcept=default |
|
| condition_variable (condition_variable &&rhs) noexcept=default |
|
future | wait () noexcept |
|
template<typename Clock = typename timer<>::clock, typename Duration = typename Clock::duration> |
future | wait (std::chrono::time_point< Clock, Duration > timeout) noexcept |
|
template<typename Rep , typename Period > |
future | wait (std::chrono::duration< Rep, Period > timeout) noexcept |
|
template<typename Pred > |
future | wait (Pred &&pred) noexcept |
|
template<typename Clock = typename timer<>::clock, typename Duration = typename Clock::duration, typename Pred > |
future | wait (std::chrono::time_point< Clock, Duration > timeout, Pred &&pred) noexcept |
|
template<typename Rep , typename Period , typename Pred > |
future | wait (std::chrono::duration< Rep, Period > timeout, Pred &&pred) noexcept |
|
bool | has_waiters () const noexcept |
|
void | signal () noexcept |
| Notify variable and wake up a waiter if there is one.
|
|
void | broadcast () noexcept |
| Notify variable and wake up all waiter.
|
|
void | broken () noexcept |
|
void | broken (std::exception_ptr) noexcept |
|