Utils/Logger: Implement TimeSource facility
[senf.git] / Scheduler / Scheduler.cc
index c758ea9..adbb6a6 100644 (file)
@@ -78,7 +78,7 @@
 // Custom includes
 #include <errno.h>
 #include <sys/epoll.h>
-#include "Utils/Exception.hh"
+#include "../Utils/Exception.hh"
 
 static const int EPollInitialSize = 16;
 
@@ -201,8 +201,8 @@ prefix_ void senf::Scheduler::process()
                 i->second.cb();
             else
                 break;
-            timerMap_.erase(i);
             timerQueue_.pop();
+            timerMap_.erase(i);
         }
 
         if (events <= 0)
@@ -243,6 +243,15 @@ prefix_ void senf::Scheduler::process()
     }
 }
 
+///////////////////////////////////////////////////////////////////////////
+// senf::SchedulerLogTimeSource
+
+prefix_ boost::posix_time::ptime senf::SchedulerLogTimeSource::operator()()
+    const
+{
+    return ClockService::abstime(Scheduler::instance().eventTime());
+}
+
 ///////////////////////////////cc.e////////////////////////////////////////
 #undef prefix_