diff options
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/qpid/broker/BrokerQueue.cpp | 9 | ||||
-rw-r--r-- | cpp/src/qpid/broker/BrokerQueue.h | 3 | ||||
-rw-r--r-- | cpp/src/qpid/sys/Serializer.cpp | 2 | ||||
-rw-r--r-- | cpp/src/qpid/sys/Serializer.h | 2 |
4 files changed, 9 insertions, 7 deletions
diff --git a/cpp/src/qpid/broker/BrokerQueue.cpp b/cpp/src/qpid/broker/BrokerQueue.cpp index f8bffa01a3..3d4d6b83be 100644 --- a/cpp/src/qpid/broker/BrokerQueue.cpp +++ b/cpp/src/qpid/broker/BrokerQueue.cpp @@ -49,7 +49,8 @@ Queue::Queue(const string& _name, bool _autodelete, next(0), exclusive(0), persistenceId(0), - serializer(false) + serializer(false), + dispatchCallback(boost::bind(&Queue::dispatch, this)) { } @@ -79,7 +80,7 @@ void Queue::recover(Message::shared_ptr& msg){ void Queue::process(Message::shared_ptr& msg){ push(msg); - serializer.execute(boost::bind(&Queue::dispatch, this)); + serializer.execute(dispatchCallback); } @@ -89,13 +90,13 @@ void Queue::requeue(Message::shared_ptr& msg){ Mutex::ScopedLock locker(messageLock); messages.push_front(msg); } - serializer.execute(boost::bind(&Queue::dispatch, this)); + serializer.execute(dispatchCallback); } void Queue::requestDispatch(){ - serializer.execute(boost::bind(&Queue::dispatch, this)); + serializer.execute(dispatchCallback); } diff --git a/cpp/src/qpid/broker/BrokerQueue.h b/cpp/src/qpid/broker/BrokerQueue.h index f82a7dac55..4214b4b03f 100644 --- a/cpp/src/qpid/broker/BrokerQueue.h +++ b/cpp/src/qpid/broker/BrokerQueue.h @@ -75,7 +75,8 @@ namespace qpid { std::auto_ptr<QueuePolicy> policy; QueueBindings bindings; boost::shared_ptr<Exchange> alternateExchange; - qpid::sys::Serializer serializer; + qpid::sys::Serializer serializer; + qpid::sys::Serializer::Task dispatchCallback; void pop(); void push(Message::shared_ptr& msg); diff --git a/cpp/src/qpid/sys/Serializer.cpp b/cpp/src/qpid/sys/Serializer.cpp index db2b3cab6d..cdc8b91694 100644 --- a/cpp/src/qpid/sys/Serializer.cpp +++ b/cpp/src/qpid/sys/Serializer.cpp @@ -64,7 +64,7 @@ void Serializer::dispatch(Task& task) { } } -void Serializer::execute(Task task) { +void Serializer::execute(Task& task) { bool needNotify = false; { Mutex::ScopedLock l(lock); diff --git a/cpp/src/qpid/sys/Serializer.h b/cpp/src/qpid/sys/Serializer.h index eba8e48555..337686cca0 100644 --- a/cpp/src/qpid/sys/Serializer.h +++ b/cpp/src/qpid/sys/Serializer.h @@ -66,7 +66,7 @@ class Serializer : private boost::noncopyable, private Runnable * paramater to the constructor was true. Otherwise task will be * enqueued for execution by a dispatch thread. */ - void execute(Task task); + void execute(Task& task); /** Execute pending tasks sequentially in calling thread. * Drains the task queue and returns, does not block for more tasks. |