diff options
author | Andrew Stitcher <astitcher@apache.org> | 2009-08-07 01:53:34 +0000 |
---|---|---|
committer | Andrew Stitcher <astitcher@apache.org> | 2009-08-07 01:53:34 +0000 |
commit | c48e4a687086a9f8a7311f97264c981d35300485 (patch) | |
tree | 0cba61603cec33e6fb9bcafd606dec90902015ca /qpid/cpp/src | |
parent | 5eb5617fa353bc2ef0b8ab829477706b4e188fb1 (diff) | |
download | qpid-python-c48e4a687086a9f8a7311f97264c981d35300485.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@801857 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
-rw-r--r-- | qpid/cpp/src/qpid/sys/Timer.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/qpid/cpp/src/qpid/sys/Timer.cpp b/qpid/cpp/src/qpid/sys/Timer.cpp index 08c6b6bd9f..4a3eef3a2d 100644 --- a/qpid/cpp/src/qpid/sys/Timer.cpp +++ b/qpid/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 << "]"); |