37 #ifndef STEAM_ENGINE_WORKER_DUMMY_TICK_H 38 #define STEAM_ENGINE_WORKER_DUMMY_TICK_H 63 typedef function<void(void)> Tick;
64 volatile uint timespan_;
72 , bind (&
DummyTick::timerLoop, this, callback)
75 INFO (
steam,
"TickService started.");
84 INFO (
steam,
"TickService shutdown.");
96 ||( 1000000/fps < std::numeric_limits<uint>::max()
97 && 1000000/fps > POLL_TIMEOUT));
99 timespan_ = 1000000/fps;
106 void timerLoop(Tick periodicFun)
109 while (0 < timespan_)
111 if (timespan_ > POLL_TIMEOUT)
116 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