You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2010/04/29 03:17:10 UTC

svn commit: r939156 - /qpid/trunk/qpid/cpp/src/qpid/sys/Timer.cpp

Author: astitcher
Date: Thu Apr 29 01:17:09 2010
New Revision: 939156

URL: http://svn.apache.org/viewvc?rev=939156&view=rev
Log:
QPID-2186: Small adjustments to previous fix:
- Turn one of the "if"s into an assert
- Fix incorrect scope for unlocking Timer monitor around fire() callback.

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=939156&r1=939155&r2=939156&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/sys/Timer.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/sys/Timer.cpp Thu Apr 29 01:17:09 2010
@@ -7,9 +7,9 @@
  * to you under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance
  * with the License.  You may obtain a copy of the License at
- * 
+ *
  *   http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing,
  * software distributed under the License is distributed on an
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -84,7 +84,7 @@ Timer::Timer() :
     start();
 }
 
-Timer::~Timer() 
+Timer::~Timer()
 {
     stop();
 }
@@ -114,8 +114,10 @@ void Timer::run()
                 }
                 continue;
             } else if(Duration(t->nextFireTime, start) >= 0) {
+                {
                 Monitor::ScopedUnlock u(monitor);
                 fire(t);
+                }
                 // Warn if callback overran next timer's start.
                 AbsTime end(AbsTime::now());
                 Duration overrun (0);
@@ -149,8 +151,8 @@ void Timer::run()
                 tasks.push(t);
             }
             }
-            if (!tasks.empty())
-                monitor.wait(tasks.top()->sortTime);
+            assert(!tasks.empty());
+            monitor.wait(tasks.top()->sortTime);
         }
     }
 }



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