6#ifndef XENIUM_BACKOFF_HPP
7#define XENIUM_BACKOFF_HPP
9#include <xenium/detail/hardware.hpp>
26 void operator()() { detail::hardware_pause(); }
29template <
unsigned Max>
30struct exponential_backoff {
31 static_assert(Max > 0,
"Max must be greater than zero. If you don't want to backoff use the `no_backoff` class.");
34 for (
unsigned i = 0; i < count; ++i)
35 detail::hardware_pause();
36 count = std::min(Max, count * 2);
Dummy backoff strategy that does nothing.
Definition: backoff.hpp:17
Simple backoff strategy that always perfoms a single hardware_pause operation.
Definition: backoff.hpp:25