From: g0dil Date: Wed, 25 Aug 2010 11:35:43 +0000 (+0000) Subject: Scheduler: Avoid unnecessary now() calls in ClockService X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=961cf85a6abf2b5f0a7958bbfcd8f72e7b32721b;p=senf.git Scheduler: Avoid unnecessary now() calls in ClockService git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1698 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/senf/Scheduler/ClockService.cci b/senf/Scheduler/ClockService.cci index 38f353b..9b70a3a 100644 --- a/senf/Scheduler/ClockService.cci +++ b/senf/Scheduler/ClockService.cci @@ -45,9 +45,11 @@ prefix_ senf::ClockService::clock_type senf::ClockService::now() //////////////////////////////////////// // private members +namespace senf { namespace scheduler { ClockService::clock_type now(); } } + prefix_ senf::ClockService::clock_type senf::ClockService::clock_m(abstime_type time) { - if (now() - baseClock_ > 1000000000ll) + if (senf::scheduler::now() - baseClock_ > 1000000000ll) restart_m(); boost::posix_time::time_duration delta (time - baseAbstime_); return baseClock_ + clock_type( delta.ticks() ) @@ -58,7 +60,7 @@ prefix_ senf::ClockService::abstime_type senf::ClockService::abstime_m(clock_typ { if (clock == 0) return abstime_type(); - if (now() - baseClock_ > 1000000000ll) + if (senf::scheduler::now() - baseClock_ > 1000000000ll) restart_m(); #ifdef BOOST_DATE_TIME_POSIX_TIME_STD_CONFIG return baseAbstime_ + boost::posix_time::nanoseconds(clock-baseClock_);