From ebfd9ff053b04ab379acfc0fefedee5a31b6d8a5 Mon Sep 17 00:00:00 2001 From: "Stephen D. Huston" Date: Fri, 21 Oct 2011 01:19:00 +0000 Subject: Undo bad merge from trunk - merged at wrong level. git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/QPID-2519@1187150 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/sys/PollableQueue.h | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'cpp/src/qpid/sys/PollableQueue.h') diff --git a/cpp/src/qpid/sys/PollableQueue.h b/cpp/src/qpid/sys/PollableQueue.h index 03b9d0084d..81c2301c1e 100644 --- a/cpp/src/qpid/sys/PollableQueue.h +++ b/cpp/src/qpid/sys/PollableQueue.h @@ -10,9 +10,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 @@ -28,8 +28,7 @@ #include #include #include -#include -#include "qpid/log/Statement.h" // FIXME aconway 2011-08-05: +#include namespace qpid { namespace sys { @@ -45,7 +44,7 @@ class Poller; template class PollableQueue { public: - typedef std::deque Batch; + typedef std::vector Batch; typedef T value_type; /** @@ -69,11 +68,11 @@ class PollableQueue { const boost::shared_ptr& poller); ~PollableQueue(); - + /** Push a value onto the queue. Thread safe */ void push(const T& t); - /** Start polling. */ + /** Start polling. */ void start(); /** Stop polling and wait for the current callback, if any, to complete. */ @@ -91,14 +90,14 @@ class PollableQueue { * ensure clean shutdown with no events left on the queue. */ void shutdown(); - + private: typedef sys::Monitor::ScopedLock ScopedLock; typedef sys::Monitor::ScopedUnlock ScopedUnlock; void dispatch(PollableCondition& cond); void process(); - + mutable sys::Monitor lock; Callback callback; PollableCondition condition; @@ -108,7 +107,7 @@ class PollableQueue { }; template PollableQueue::PollableQueue( - const Callback& cb, const boost::shared_ptr& p) + const Callback& cb, const boost::shared_ptr& p) : callback(cb), condition(boost::bind(&PollableQueue::dispatch, this, _1), p), stopped(true) @@ -152,7 +151,7 @@ template void PollableQueue::process() { putBack = callback(batch); } // put back unprocessed items. - queue.insert(queue.begin(), putBack, typename Batch::const_iterator(batch.end())); + queue.insert(queue.begin(), putBack, typename Batch::const_iterator(batch.end())); batch.clear(); } } -- cgit v1.2.1