25 bool expect_false =
false;
26 while(!atomic_compare_exchange_strong(&_callback_variables_busy, &expect_false,
true))
29 _callback_variables_busy.store(
false, std::memory_order_release);
31 SYS_ASSERT(!(func && _expiration_callback), misc_exception,
"Setting a platform_timer callback when one already exists");
33 _expiration_callback = func;
34 _expiration_callback_data = user;
41 constexpr static size_t fwd_size = 8;
44 void call_expiration_callback() {
45 bool expect_false =
false;
46 if(atomic_compare_exchange_strong(&_callback_variables_busy, &expect_false,
true)) {
47 void(*cb)(
void*) = _expiration_callback;
48 void* cb_data = _expiration_callback_data;
52 _callback_variables_busy.store(
false, std::memory_order_release);
56 std::atomic_bool _callback_variables_busy =
false;
57 void(*_expiration_callback)(
void*) =
nullptr;
58 void* _expiration_callback_data;