summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/client/ConnectionImpl.h
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2010-04-15 18:08:04 +0000
committerGordon Sim <gsim@apache.org>2010-04-15 18:08:04 +0000
commit339c98598ac775e21e456c60bdbbdb84655f7a40 (patch)
tree2a3e1bc9a33aad9d3f881a7b025136d59305a367 /cpp/src/qpid/client/ConnectionImpl.h
parent1da2769ba27a7b40ad88b6acc526311a45fed3ee (diff)
downloadqpid-python-339c98598ac775e21e456c60bdbbdb84655f7a40.tar.gz
QPID-2511: Altered shutdown sequence in connectors; after connect() has returned there will always now be a shutdown callback made and only at that point is it guaranteed that there will be no further io callbacks. ConnectionImpl consequently waits for this before allowing itself to be deleted.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@934503 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/client/ConnectionImpl.h')
-rw-r--r--cpp/src/qpid/client/ConnectionImpl.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/cpp/src/qpid/client/ConnectionImpl.h b/cpp/src/qpid/client/ConnectionImpl.h
index 1d88fcaf99..c2313e72bc 100644
--- a/cpp/src/qpid/client/ConnectionImpl.h
+++ b/cpp/src/qpid/client/ConnectionImpl.h
@@ -26,7 +26,7 @@
#include "qpid/client/ConnectionHandler.h"
#include "qpid/framing/FrameHandler.h"
-#include "qpid/sys/Mutex.h"
+#include "qpid/sys/Monitor.h"
#include "qpid/sys/ShutdownHandler.h"
#include "qpid/sys/TimeoutHandler.h"
@@ -60,7 +60,8 @@ class ConnectionImpl : public Bounds,
boost::scoped_ptr<Connector> connector;
framing::ProtocolVersion version;
uint16_t nextChannel;
- sys::Mutex lock;
+ sys::Monitor lock;
+ bool shutdownComplete;
boost::intrusive_ptr<qpid::sys::TimerTask> heartbeatTask;
@@ -72,6 +73,9 @@ class ConnectionImpl : public Bounds,
void idleOut();
void idleIn();
void shutdown();
+ void failedConnection();
+ void waitForShutdownComplete();
+ void notifyShutdownComplete();
boost::function<void ()> failureCallback;