From f27a733f9a4cca3ad2a42acb35ab4620a47e320d Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Mon, 25 Oct 2010 18:00:34 +0000 Subject: New cluster: core framework and initial implementation of enqueue logic. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1027210 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/cluster/PollerDispatch.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'cpp/src/qpid/cluster/PollerDispatch.cpp') diff --git a/cpp/src/qpid/cluster/PollerDispatch.cpp b/cpp/src/qpid/cluster/PollerDispatch.cpp index b8d94b95a5..43c171efe8 100644 --- a/cpp/src/qpid/cluster/PollerDispatch.cpp +++ b/cpp/src/qpid/cluster/PollerDispatch.cpp @@ -37,9 +37,11 @@ PollerDispatch::PollerDispatch(Cpg& c, boost::shared_ptr p, started(false) {} -PollerDispatch::~PollerDispatch() { - if (started) - dispatchHandle.stopWatch(); +PollerDispatch::~PollerDispatch() { stop(); } + +void PollerDispatch::stop() { + if (started) dispatchHandle.stopWatch(); + started = false; } void PollerDispatch::start() { @@ -54,6 +56,7 @@ void PollerDispatch::dispatch(sys::DispatchHandle& h) { h.rewatch(); } catch (const std::exception& e) { QPID_LOG(critical, "Error in cluster dispatch: " << e.what()); + stop(); onError(); } } -- cgit v1.2.1