X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Scheduler%2FTimerEvent.ih;h=a6ecf9b7470f3af5fccae7b979ed5e1c1acf1725;hb=4e05bff7db89ed83bfe3846c56273c7c91c6be59;hp=1c5ea524da73b59b3ff0fee75deacf7c30051f74;hpb=412024ed31a4ab4eaea7a4165a434f8efebee325;p=senf.git diff --git a/Scheduler/TimerEvent.ih b/Scheduler/TimerEvent.ih index 1c5ea52..a6ecf9b 100644 --- a/Scheduler/TimerEvent.ih +++ b/Scheduler/TimerEvent.ih @@ -27,7 +27,9 @@ #define IH_SENF_Scheduler_TimerEvent_ 1 // Custom includes +#include #include "../boost/intrusive/iset.hpp" +#include "TimerSource.hh" ///////////////////////////////ih.p//////////////////////////////////////// @@ -44,8 +46,7 @@ namespace detail { }; class TimerDispatcher - : public detail::FdManager::Event, - public singleton + : public singleton { SENF_LOG_CLASS_AREA(); @@ -56,31 +57,29 @@ namespace detail { void add(TimerEvent & event); void remove(TimerEvent & event); - void unblockSignals(); - void blockSignals(); - + void enable(); + void disable(); + + void prepareRun(); + void reschedule(); + bool empty() const; + void setTimerSource(std::auto_ptr timerSource); + protected: private: TimerDispatcher(); ~TimerDispatcher(); - virtual void signal(int events); - static void sigHandler(int signal, ::siginfo_t * siginfo, void *); - void reschedule(); - typedef boost::intrusive::imultiset< TimerSetBase::value_traits, TimerSetCompare, false > TimerSet; TimerSet timers_; - int timerPipe_[2]; - sigset_t sigSet_; - bool blocked_; - timer_t timerId_; + boost::scoped_ptr source_; friend void senf::scheduler::restart(); friend class singleton;