- /// Returns true if the wait succeeded, false if the turn is in the past
- bool tryWaitForTurn(const uint32_t turn,
- Atom<uint32_t>& spinCutoff,
- const bool updateSpinCutoff) noexcept {
+ /// Returns SUCCESS if the wait succeeded, PAST if the turn is in the past
+ /// or TIMEDOUT if the absTime time value is not nullptr and is reached before
+ /// the turn arrives
+ template <
+ class Clock = std::chrono::steady_clock,
+ class Duration = typename Clock::duration>
+ TryWaitResult tryWaitForTurn(
+ const uint32_t turn,
+ Atom<uint32_t>& spinCutoff,
+ const bool updateSpinCutoff,
+ const std::chrono::time_point<Clock, Duration>* absTime =
+ nullptr) noexcept {