34 PeriodicTask::PeriodicTask(
const unsigned int& ms,
bool accountProcTime) :
35 cycleTime(ms), logger(
36 rsc::logging::Logger::
getLogger(
"rsc.threading.PeriodicTask")), fixedScheduling(
37 accountProcTime), nextProcessingStart(0) {
62 "PeriodicTask()::continueExec() before thread sleep, sleeping " <<
cycleTime <<
" ms");
64 boost::this_thread::sleep(
65 boost::posix_time::microseconds(
69 boost::this_thread::sleep(
70 boost::posix_time::microseconds(
cycleTime * 1000));
72 }
catch (
const boost::thread_interrupted& e) {
77 "PeriodicTask()::continueExec() caught boost::thread_interrupted exception");
79 }
RSCTRACE(
logger,
"PeriodicTask()::continueExec() thread woke up");
virtual bool continueExec()
Implements a waiting logic for the continuation of the repetitive task.
virtual bool isCancelRequested()
Tells whether the task was interrupted by a call to cancel.
boost::uint64_t currentTimeMicros()
Returns the current system time as microseconds.
#define RSCWARN(logger, msg)
boost::uint64_t nextProcessingStart
#define RSCTRACE(logger, msg)
rsc::logging::LoggerPtr logger