qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From astitc...@apache.org
Subject svn commit: r801857 - /qpid/trunk/qpid/cpp/src/qpid/sys/Timer.cpp
Date Fri, 07 Aug 2009 01:53:34 GMT
Author: astitcher
Date: Fri Aug  7 01:53:34 2009
New Revision: 801857

URL: http://svn.apache.org/viewvc?rev=801857&view=rev
Log:
When setting up the next fire time for a Timer make sure it can't be in the past.

Modified:
    qpid/trunk/qpid/cpp/src/qpid/sys/Timer.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/sys/Timer.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/sys/Timer.cpp?rev=801857&r1=801856&r2=801857&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/sys/Timer.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/sys/Timer.cpp Fri Aug  7 01:53:34 2009
@@ -55,9 +55,10 @@
     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 << "]");



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message