summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/sys
diff options
context:
space:
mode:
authorAndrew Stitcher <astitcher@apache.org>2009-08-07 01:53:34 +0000
committerAndrew Stitcher <astitcher@apache.org>2009-08-07 01:53:34 +0000
commit2208ab2fb32db9403a633f167d97b48fce1be7a4 (patch)
treef82dfe381d804106257d69aea5bab949a3f53ff2 /cpp/src/qpid/sys
parent97dbf7f64f85558d0b91bbb11f793ec896495bca (diff)
downloadqpid-python-2208ab2fb32db9403a633f167d97b48fce1be7a4.tar.gz
When setting up the next fire time for a Timer make sure it can't be in the past.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@801857 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/sys')
-rw-r--r--cpp/src/qpid/sys/Timer.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/cpp/src/qpid/sys/Timer.cpp b/cpp/src/qpid/sys/Timer.cpp
index 08c6b6bd9f..4a3eef3a2d 100644
--- a/cpp/src/qpid/sys/Timer.cpp
+++ b/cpp/src/qpid/sys/Timer.cpp
@@ -55,9 +55,10 @@ void TimerTask::fireTask() {
fire();
}
+// This can only be used to setup the next fire time. After the Timer has already fired
void TimerTask::setupNextFire() {
if (period && readyToFire()) {
- nextFireTime = AbsTime(nextFireTime, period);
+ nextFireTime = max(AbsTime::now(), AbsTime(nextFireTime, period));
cancelled = false;
} else {
QPID_LOG(error, "Couldn't setup next timer firing: " << Duration(nextFireTime, AbsTime::now()) << "[" << period << "]");