17 #ifndef HH_SENF_Scheduler_FIFORunner_ 18 #define HH_SENF_Scheduler_FIFORunner_ 1 22 #include <boost/function.hpp> 23 #include <boost/intrusive/list.hpp> 24 #include <boost/intrusive/list_hook.hpp> 44 typedef boost::function<void(std::string const &, std::string const &, std::string const &, unsigned, unsigned)>
WatchdogCallback;
48 typedef boost::intrusive::list_base_hook< boost::intrusive::tag<TaskListTag> > TaskListBase;
49 typedef boost::intrusive::list<
TaskInfo,
50 boost::intrusive::constant_time_size<false>,
51 boost::intrusive::base_hook<TaskListBase> > TaskList;
72 virtual void v_run() = 0;
73 virtual bool v_enabled()
const;
77 std::string backtrace_;
82 typedef boost::filter_iterator<
106 iterator
begin()
const;
107 iterator
end()
const;
117 static void watchdog(
int, siginfo_t *,
void *);
118 void watchdogError();
121 void run(TaskList::iterator f, TaskList::iterator l);
123 struct NullTask :
public TaskInfo
127 virtual void v_run();;
128 virtual char const * v_type()
const;
129 virtual std::string v_info()
const;
133 TaskList::iterator next_;
136 NullTask normalPriorityEnd_;
137 NullTask highPriorityEnd_;
140 bool watchdogRunning_;
141 unsigned watchdogMs_;
143 const char * watchdogCheckpoint_;
145 TaskInfo * runningTask_;
146 std::string runningName_;
147 std::string runningBacktrace_;
149 WatchdogCallback watchdogCallback_;
150 unsigned watchdogCount_;
unsigned taskTimeout() const
boost::function< void(std::string const &, std::string const &, std::string const &, unsigned, unsigned)> WatchdogCallback
EventManager public header.
boost::filter_iterator< EventManager::IteratorFilter, TaskList::const_iterator > iterator
void enqueue(TaskInfo *task)
std::string const & name() const
Get event name.
TaskInfo(std::string const &name, Priority priority=PRIORITY_NORMAL)
void restart()
Restart scheduler.
bool abortOnTimeout() const
void dequeue(TaskInfo *task)
void watchdogCallback(WatchdogCallback const &cb)
void watchdogCheckpoint(const char *checkpoint)