28 #ifndef STEAM_ENGINE_WORKER_DUMMY_TICK_H 29 #define STEAM_ENGINE_WORKER_DUMMY_TICK_H 54 typedef function<void(void)> Tick;
55 volatile uint timespan_;
63 , bind (&
DummyTick::timerLoop, this, callback)
66 INFO (
steam,
"TickService started.");
75 INFO (
steam,
"TickService shutdown.");
87 ||( 1000000/fps < std::numeric_limits<uint>::max()
88 && 1000000/fps > POLL_TIMEOUT));
90 timespan_ = 1000000/fps;
97 void timerLoop(Tick periodicFun)
100 while (0 < timespan_)
102 if (timespan_ > POLL_TIMEOUT)
107 TRACE (proc_dbg,
"Tick Thread timer loop exiting...");
Variant of the standard case, requiring to wait and join() on the termination of this thread...
Tick generating service for a periodic callback, with adjustable frequency.
void activate(uint fps)
set the periodic timer to run with a given frequency, starting now.
Steam-Layer implementation namespace root.
ThreadJoinable(string const &, FUN &&, ARGS &&...) -> ThreadJoinable< std::invoke_result_t< FUN, ARGS... >>
deduction guide: find out about result value to capture from a generic callable.
lib::Result< void > join()
put the caller into a blocking wait until this thread has terminated
Convenience front-end to simplify and codify basic thread handling.
Lumiera error handling (C++ interface).
static const uint POLL_TIMEOUT
poll interval for new settings in wait state