You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2013/06/10 22:52:20 UTC
svn commit: r1491595 -
/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/CompositeTaskRunner.cpp
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);
}
}
}