55 template <
bool MayBlock = true,
template <
typename>
class Atom = std::atomic>
88 auto s =
state_.load(std::memory_order_acquire);
116 state_.store(
INIT, std::memory_order_relaxed);
128 ((1 <<
state_.load(std::memory_order_relaxed)) &
140 if (before ==
INIT &&
141 state_.compare_exchange_strong(
144 std::memory_order_release,
145 std::memory_order_relaxed)) {
205 template <
typename Rep,
typename Period>
207 const std::chrono::duration<Rep, Period>& timeout,
228 template <
typename Clock,
typename Duration>
230 const std::chrono::time_point<Clock, Duration>& deadline,
240 template <
typename Rep,
typename Period>
242 const std::chrono::duration<Rep, Period>& timeout)
noexcept {
247 template <
typename Clock,
typename Duration>
249 const std::chrono::time_point<Clock, Duration>& deadline)
noexcept {
262 template <
typename Clock,
typename Duration>
264 const std::chrono::time_point<Clock, Duration>& deadline,
288 if (!
state_.compare_exchange_strong(
291 std::memory_order_relaxed,
292 std::memory_order_relaxed)) {
296 std::atomic_thread_fence(std::memory_order_acquire);
static FutexResult futexWaitUntil(Futex &fut, uint32_t expected, Deadline const &deadline, uint32_t waitMask=-1, IdleTime const &idleTimeout=defaultIdleTimeout.load(std::memory_order_acquire), size_t stackToRetain=kDefaultStackToRetain, float timeoutVariationFrac=0.5)
spin_result spin_yield_until(std::chrono::time_point< Clock, Duration > const &deadline, F f)
#define FOLLY_ALWAYS_INLINE
std::chrono::steady_clock::time_point now()
Atom< std::uint32_t > Futex
FOLLY_ALWAYS_INLINE bool timed_wait(const std::chrono::duration< Rep, Period > &timeout) noexcept
Alias to try_wait_for. Deprecated.
—— Concurrent Priority Queue Implementation ——
requires E e noexcept(noexcept(s.error(std::move(e))))
FOLLY_ALWAYS_INLINE bool try_wait_until(const std::chrono::time_point< Clock, Duration > &deadline, const WaitOptions &opt=wait_options()) noexcept
Baton & operator=(Baton const &)=delete
FOLLY_ALWAYS_INLINE bool try_wait_for(const std::chrono::duration< Rep, Period > &timeout, const WaitOptions &opt=wait_options()) noexcept
FOLLY_ALWAYS_INLINE void wait(const WaitOptions &opt=wait_options()) noexcept
FOLLY_ALWAYS_INLINE bool ready() const noexcept
detail::Futex< Atom > state_
constexpr Baton() noexcept
static FOLLY_ALWAYS_INLINE WaitOptions wait_options()
FOLLY_ALWAYS_INLINE bool timed_wait(const std::chrono::time_point< Clock, Duration > &deadline) noexcept
Alias to try_wait_until. Deprecated.
FOLLY_ALWAYS_INLINE bool try_wait() const noexcept
FOLLY_NOINLINE bool tryWaitSlow(const std::chrono::time_point< Clock, Duration > &deadline, const WaitOptions &opt) noexcept
spin_result spin_pause_until(std::chrono::time_point< Clock, Duration > const &deadline, WaitOptions const &opt, F f)
int futexWake(const Futex *futex, int count, uint32_t wakeMask)