From c212333a21ca81015035441ad4c7db185581742a Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Fri, 5 Sep 2008 16:30:03 +0000 Subject: src/qpid/client/SubscriptionManager.cpp: added start(). src/tests* improvements to multi-host test scripts. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@692478 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/client/SubscriptionManager.cpp | 6 ++++++ cpp/src/qpid/client/SubscriptionManager.h | 13 +++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) (limited to 'cpp/src/qpid') diff --git a/cpp/src/qpid/client/SubscriptionManager.cpp b/cpp/src/qpid/client/SubscriptionManager.cpp index b4c48f7365..e4d68e723f 100644 --- a/cpp/src/qpid/client/SubscriptionManager.cpp +++ b/cpp/src/qpid/client/SubscriptionManager.cpp @@ -124,6 +124,12 @@ void SubscriptionManager::run() dispatcher.run(); } +void SubscriptionManager::start() +{ + dispatcher.setAutoStop(autoStop); + dispatcher.start(); +} + void SubscriptionManager::stop() { dispatcher.stop(); diff --git a/cpp/src/qpid/client/SubscriptionManager.h b/cpp/src/qpid/client/SubscriptionManager.h index 3dad15fd29..3a463d9038 100644 --- a/cpp/src/qpid/client/SubscriptionManager.h +++ b/cpp/src/qpid/client/SubscriptionManager.h @@ -134,16 +134,25 @@ class SubscriptionManager : public sys::Runnable /** Cancel a subscription. */ void cancel(const std::string tag); - /** Deliver messages until stop() is called. */ + /** Deliver messages in the current thread until stop() is called. + * Only one thread may be running in a SubscriptionManager at a time. + * @see run + */ void run(); + /** Start a new thread to deliver messages. + * Only one thread may be running in a SubscriptionManager at a time. + * @see start + */ + void start(); + /** If set true, run() will stop when all subscriptions * are cancelled. If false, run will only stop when stop() * is called. True by default. */ void setAutoStop(bool set=true); - /** Cause run() to return */ + /** Stop delivery. Causes run() to return, or the thread started with start() to exit. */ void stop(); static const uint32_t UNLIMITED=0xFFFFFFFF; -- cgit v1.2.1