activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1491595 - /activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/CompositeTaskRunner.cpp
Date Mon, 10 Jun 2013 20:52:20 GMT
Author: tabish
Date: Mon Jun 10 20:52:19 2013
New Revision: 1491595

URL: http://svn.apache.org/r1491595
Log:
fix for: https://issues.apache.org/jira/browse/AMQCPP-487

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/CompositeTaskRunner.cpp

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/CompositeTaskRunner.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/CompositeTaskRunner.cpp?rev=1491595&r1=1491594&r2=1491595&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/CompositeTaskRunner.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/CompositeTaskRunner.cpp
Mon Jun 10 20:52:19 2013
@@ -182,18 +182,18 @@ bool CompositeTaskRunner::iterate() {
 
     synchronized(&tasks) {
 
-        auto_ptr<Iterator<CompositeTask*> > iter(tasks.iterator());
-
-        while (iter->hasNext()) {
-
-            CompositeTask* task = iter->next();
+        for (int i = 0; i < tasks.size(); ++i) {
+            CompositeTask* task = tasks.pop();
 
             if (task->isPending()) {
                 task->iterate();
+                tasks.addLast(task);
 
                 // Always return true, so that we check again for any of
                 // the other tasks that might now be pending.
                 return true;
+            } else {
+                tasks.addLast(task);
             }
         }
     }



Mime
View raw message