X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Scheduler%2FFIFORunner.hh;h=40154d38f23a29834c95780d7b8690eeb277d4b2;hb=a634d4df375e12f0a9dcd0014f1ee14b70de16b8;hp=a6db0a5cb81724883110a1eca612ccffc41f595c;hpb=ac90835cbb00ca83a51ab9efb23fdcb75518e808;p=senf.git diff --git a/Scheduler/FIFORunner.hh b/Scheduler/FIFORunner.hh index a6db0a5..40154d3 100644 --- a/Scheduler/FIFORunner.hh +++ b/Scheduler/FIFORunner.hh @@ -32,6 +32,7 @@ #include "../boost/intrusive/ilist.hpp" #include "../boost/intrusive/ilist_hook.hpp" #include "../Utils/singleton.hh" +#include "EventManager.hh" //#include "FIFORunner.mpp" ///////////////////////////////hh.p//////////////////////////////////////// @@ -56,26 +57,35 @@ namespace detail { public: class TaskInfo - : public TaskListBase + : public Event, + public TaskListBase { public: explicit TaskInfo(std::string const & name); virtual ~TaskInfo(); + void run(); + + bool runnable() const; + protected: void setRunnable(); private: - virtual void run() = 0; + virtual void v_run() = 0; + virtual bool v_enabled() const; bool runnable_; - std::string name_; # ifdef SENF_DEBUG std::string backtrace_; # endif friend class FIFORunner; }; + + typedef boost::filter_iterator< + EventManager::IteratorFilter, TaskList::const_iterator> iterator; + using singleton::instance; using singleton::alive; @@ -87,11 +97,10 @@ namespace detail { void taskTimeout(unsigned ms); unsigned taskTimeout() const; - unsigned hangCount() const; ///< Number of task expirations - /**< The FIFORunner manages a watchdog which checks, that a - single task does not run continuously for a longer time - or block. If a task runs for more than 1s, a warning is - printed and the hangCount is increased. */ + unsigned hangCount() const; + + iterator begin() const; + iterator end() const; protected: