summaryrefslogtreecommitdiff
path: root/cpp/src/qpid
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/qpid')
-rw-r--r--cpp/src/qpid/client/SubscriptionManager.cpp6
-rw-r--r--cpp/src/qpid/client/SubscriptionManager.h13
2 files changed, 17 insertions, 2 deletions
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;