diff options
-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 << "]"); |