6 #ifndef XENIUM_BACKOFF_HPP
7 #define XENIUM_BACKOFF_HPP
9 #include <xenium/detail/hardware.hpp>
26 void operator()() { detail::hardware_pause(); }
29 template <
unsigned Max>
30 struct 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);