35#ifndef _UTILS_EXECUTORWATCHDOG_HXX_
36#define _UTILS_EXECUTORWATCHDOG_HXX_
69 LOG(
WARNING,
"[WARN] Executor was blocked for %d msec",
72 if (++
count_ > (5000 / 50))
80 StateFlowTimer timer_ {
this};
#define STATE(_fn)
Turns a function name into an argument to be supplied to functions expecting a state.
This stateflow checks an executor every 50 msec.
uint32_t lastTimeMsec_
Timestamp when we last went to sleep.
ExecutorWatchdog(Service *service)
Constructor.
int count_
Counter that controls printing a heartbeat message that we are fine.
Collection of related state machines that pend on incoming messages.
Base class for state machines.
Service * service()
Return a pointer to the service I am bound to.
void start_flow(Callback c)
Resets the flow to the specified state and starts it.
Action call_immediately(Callback c)
Imediately call the next state upon return.
Action sleep_and_call(::Timer *timer, long long timeout_nsec, Callback c)
Suspends execution of this control flow for a specified time.
#define LOG(level, message...)
Conditionally write a message to the logging output.
static const int WARNING
Loglevel that is always printed, reporting a warning or a retryable error.
static const int INFO
Loglevel that is printed by default, reporting some status information.
long long os_get_time_monotonic(void)
Get the monotonic time since the system started.
#define MSEC_TO_NSEC(_msec)
Convert a millisecond value to a nanosecond value.
#define NSEC_TO_MSEC(_nsec)
Convert a nanosecond value to a millisecond value.