X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Scheduler%2FFIFORunner.hh;h=756f07fc4db38f98536ec8d3778f95c95ff6bc50;hb=925317c7f45c32b01ab9292023db3f372b74bf0f;hp=464d4f4e2a804753532226a2a787750b227be7c5;hpb=46ce25973f087d30ca10eebdad6e3bfa7586ecc9;p=senf.git diff --git a/Scheduler/FIFORunner.hh b/Scheduler/FIFORunner.hh index 464d4f4..756f07f 100644 --- a/Scheduler/FIFORunner.hh +++ b/Scheduler/FIFORunner.hh @@ -31,11 +31,15 @@ #include #include "../boost/intrusive/ilist.hpp" #include "../boost/intrusive/ilist_hook.hpp" +#include "../Utils/singleton.hh" //#include "FIFORunner.mpp" ///////////////////////////////hh.p//////////////////////////////////////// namespace senf { + + class Scheduler; + namespace scheduler { /** \brief Task execution scheduler @@ -48,7 +52,7 @@ namespace scheduler { is posted for the task. */ class FIFORunner - : boost::noncopyable + : public singleton { public: struct TaskInfo; @@ -56,8 +60,7 @@ namespace scheduler { private: struct TaskListTag; typedef boost::intrusive::ilist_base_hook TaskListBase; - typedef TaskListBase::value_traits TaskListType; - typedef boost::intrusive::ilist TaskList; + typedef boost::intrusive::ilist, false> TaskList; public: /////////////////////////////////////////////////////////////////////////// @@ -89,8 +92,8 @@ namespace scheduler { ///\name Structors and default members ///@{ - FIFORunner(); - ~FIFORunner(); + using singleton::instance; + using singleton::alive; ///@} /////////////////////////////////////////////////////////////////////////// @@ -112,6 +115,9 @@ namespace scheduler { protected: private: + FIFORunner(); + ~FIFORunner(); + static void watchdog(int, siginfo_t *, void *); TaskList tasks_; @@ -124,6 +130,9 @@ namespace scheduler { # endif unsigned watchdogCount_; unsigned hangCount_; + + friend class singleton; + friend class senf::Scheduler; };