diff options
author | Kim van der Riet <kpvdr@apache.org> | 2013-02-28 16:14:30 +0000 |
---|---|---|
committer | Kim van der Riet <kpvdr@apache.org> | 2013-02-28 16:14:30 +0000 |
commit | 9c73ef7a5ac10acd6a50d5d52bd721fc2faa5919 (patch) | |
tree | 2a890e1df09e5b896a9b4168a7b22648f559a1f2 /cpp/src/qpid/sys/Timer.cpp | |
parent | 172d9b2a16cfb817bbe632d050acba7e31401cd2 (diff) | |
download | qpid-python-asyncstore.tar.gz |
Update from trunk r1375509 through r1450773asyncstore
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/asyncstore@1451244 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/sys/Timer.cpp')
-rw-r--r-- | cpp/src/qpid/sys/Timer.cpp | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/cpp/src/qpid/sys/Timer.cpp b/cpp/src/qpid/sys/Timer.cpp index 973c6bd8b7..f8eef2c9ec 100644 --- a/cpp/src/qpid/sys/Timer.cpp +++ b/cpp/src/qpid/sys/Timer.cpp @@ -96,18 +96,13 @@ void TimerTask::cancel() { state = CANCELLED; } -void TimerTask::setFired() { - // Set nextFireTime to just before now, making readyToFire() true. - nextFireTime = AbsTime(sys::now(), Duration(-1)); -} - - +// TODO AStitcher 21/08/09 The threshholds for emitting warnings are a little arbitrary Timer::Timer() : active(false), late(50 * TIME_MSEC), overran(2 * TIME_MSEC), lateCancel(500 * TIME_MSEC), - warn(5 * TIME_SEC) + warn(60 * TIME_SEC) { start(); } @@ -133,7 +128,6 @@ public: } }; -// TODO AStitcher 21/08/09 The threshholds for emitting warnings are a little arbitrary void Timer::run() { Monitor::ScopedLock l(monitor); @@ -151,10 +145,6 @@ void Timer::run() { TimerTaskCallbackScope s(*t); if (s) { - { - Monitor::ScopedUnlock u(monitor); - drop(t); - } if (delay > lateCancel) { QPID_LOG(debug, t->name << " cancelled timer woken up " << delay / TIME_MSEC << "ms late"); @@ -171,8 +161,8 @@ void Timer::run() if (!tasks.empty()) { overrun = Duration(tasks.top()->nextFireTime, end); } - bool warningsEnabled; - QPID_LOG_TEST(warning, warningsEnabled); + bool warningsEnabled; // TimerWarning enabled + QPID_LOG_TEST(debug, warningsEnabled); // TimerWarning emitted at debug level if (warningsEnabled) { if (overrun > overran) { if (delay > overran) // if delay is significant to an overrun. @@ -235,9 +225,6 @@ void Timer::fire(boost::intrusive_ptr<TimerTask> t) { } } -// Provided for subclasses: called when a task is droped. -void Timer::drop(boost::intrusive_ptr<TimerTask>) {} - bool operator<(const intrusive_ptr<TimerTask>& a, const intrusive_ptr<TimerTask>& b) { |